AIsOfCatan.StarterAgent.OpponentTileValue C# (CSharp) Method

OpponentTileValue() private method

private OpponentTileValue ( int tile, IBoard board ) : int
tile int
board IBoard
return int
        private int OpponentTileValue(int tile, IBoard board)
        {
            int value = 0;

            foreach (Intersection i in board.GetAdjacentIntersections(tile))
            {
                Piece curPiece = board.GetPiece(i);
                if (curPiece != null && curPiece.Player != id)
                {
                    value += curPiece.Token == Token.City ? 2 : 1;
                }
            }

            return Chances(board.GetTile(tile).Value) * value;
        }