Exemple #1
0
        public void should_generate_moves_properly()
        {
            _fieldsGraph = new TestFieldsGraph(
                new[]
            {
                new[] { Empty, Empty, Empty, Empty, Empty },
                new[] { Empty, Empty, Empty, Empty, Empty },
                new[] { Empty, Empty, Black, Empty, Empty },
                new[] { Empty, Empty, Black, Empty, Empty },
                new[] { Empty, Empty, Empty, Empty, Empty },
                new[] { Empty, Empty, Black, Empty, Empty },
                new[] { Empty, Empty, White, Empty, Empty },
                new[] { Empty, Empty, Empty, Empty, Empty },
                new[] { Empty, Empty, Empty, Empty, Empty },
                new[] { Empty, Empty, Empty, Empty, Empty },
            }
                ).Build();

            var current      = new RootedBySelectingWhiteFieldBoardJumpTree(_fieldsGraph);
            var currentMoves =
                current.TraverseDfs(
                    new PerformMovesNodeVisitor(PerformMoves.DontCareAboutPlayerStateChange(_fieldsGraph)))
                .Skip(1).ToList();

            currentMoves.ShouldHaveCount(2);
        }
Exemple #2
0
        public PhutballMoveScore Search(IFieldsGraph fieldsGraph)
        {
            if (_alphaBetaSearchDepth.SearchDepth == 0)
            {
                return(PhutballMoveScore.Empty());
            }
            var actualGraph  = (IFieldsGraph)fieldsGraph.Clone();
            var performMoves = new PerformMoves(actualGraph, _playersState);
            var visitedNodes = new VisitedNodesCounter <JumpNode>();

            _alphaBetaSearch = new AlphaBetaSearch <JumpNode>(
                new WhiteStoneToCurrentPlayerBorderDistance(_playersState, actualGraph, _alphaBetaSearchDepth.DistanceToBorderWeight)
                .Add(new BlackStoneToTargetBorderCount(_playersState, actualGraph, _alphaBetaSearchDepth.BlackStonesToBorderWeight))
                ,
                _alphaBetaSearchDepth,
                new PerformMovesNodeVisitor(performMoves).FollowedBy(visitedNodes)
                );

            var movesTree = _movesFactory(actualGraph);

            _alphaBetaSearch.Run(movesTree);
            var result = new CompositeMove();

            _alphaBetaSearch.BestMove.Move.MovesFromRoot.CollectToPlayerSwitch(result);
            return(new PhutballMoveScore(result, _alphaBetaSearch.BestMove.Score)
            {
                CuttoffsCount = _alphaBetaSearch.CuttoffsCount,
                VisitedNodesCount = visitedNodes.Count
            });
        }
        public void should_generate_moves_properly()
        {
            _fieldsGraph = new TestFieldsGraph(
                new[]
                    {
                        new[] {Empty, Empty, Empty, Empty, Empty},
                        new[] {Empty, Empty, Empty, Empty, Empty},
                        new[] {Empty, Empty, Black, Empty, Empty},
                        new[] {Empty, Empty, Black, Empty, Empty},
                        new[] {Empty, Empty, Empty, Empty, Empty},
                        new[] {Empty, Empty, Black, Empty, Empty},
                        new[] {Empty, Empty, White, Empty, Empty},
                        new[] {Empty, Empty, Empty, Empty, Empty},
                        new[] {Empty, Empty, Empty, Empty, Empty},
                        new[] {Empty, Empty, Empty, Empty, Empty},
                    }
                ).Build();

            var current = new RootedBySelectingWhiteFieldBoardJumpTree(_fieldsGraph);
            var currentMoves =
                current.TraverseDfs(
                    new PerformMovesNodeVisitor(PerformMoves.DontCareAboutPlayerStateChange(_fieldsGraph)))
                    .Skip(1).ToList();

            currentMoves.ShouldHaveCount(2);
        }
        public PhutballMoveScore Search(IFieldsGraph fieldsGraph)
        {
            var graphCopy = (IFieldsGraph)fieldsGraph.Clone();
            var tree = _movesFactory.GetMovesTree(graphCopy);
            var targetBorder = _playersState.CurrentPlayer.GetTargetBorder(fieldsGraph);

            var cuttoffVisitor = new CuttoffPickBestValueNodeVisitor(targetBorder, graphCopy, _playersState)
                                     {
                                         CuttoffToTargetBorder = CuttoffToTarget
                                     };
            var performMoves = cuttoffVisitor.MovesPerformer;
            var depthCounter = new DepthCounterNodeVisitor<JumpNode>();
            var stopOnMaxNodesVisited = new StopOnVisitedNodesCount<JumpNode>(MaxVisitedNodes);
            var searchNodeVisitor = stopOnMaxNodesVisited
                .FollowedBy(cuttoffVisitor)
                .FollowedBy(depthCounter)
                .FollowedBy(_defaultNodeVistor);
            var search = _searchFactory(searchNodeVisitor, performMoves, targetBorder);
            search.Run(tree);
            return new PhutballMoveScore(cuttoffVisitor.PickBestValue.ResultMove, cuttoffVisitor.PickBestValue.CurrentMaxValue)
                       {
                           VisitedNodesCount = stopOnMaxNodesVisited.VistedNodesCount,
                           MaxDepth = depthCounter.MaxDepth,
                           CuttoffsCount = cuttoffVisitor.CuttoffsCount
                       };
        }
Exemple #5
0
 public FieldJumpIterator(Field start, IFieldsGraph fieldsGraph, StoneMover stoneMover)
 {
     _start       = start;
     Current      = _start;
     _fieldsGraph = fieldsGraph;
     _stoneMover  = stoneMover;
 }
Exemple #6
0
 public StoneJumper(IFieldsGraph fieldsGraph, Field from, Field to)
 {
     _fieldsGraph    = fieldsGraph;
     _from           = from;
     _to             = to;
     _jumpersFactory = new JumpersFactory(_fieldsGraph);
 }
Exemple #7
0
        public Tuple <TimeSpan, PhutballMoveScore> brute_force_time(IFieldsGraph graph)
        {
            var search = GetSearchEngine(graph);
            var time   = MessureTime(() => search.Search(graph));

            return(Tuple.Create(time.Item1, time.Item2));
        }
 public FieldJumpIterator(Field start, IFieldsGraph fieldsGraph, StoneMover stoneMover)
 {
     _start = start;
     Current = _start;
     _fieldsGraph = fieldsGraph;
     _stoneMover = stoneMover;
 }
Exemple #9
0
 public StoneJumper(IFieldsGraph fieldsGraph, Field from, Field to)
 {
     _fieldsGraph = fieldsGraph;
     _from = from;
     _to = to;
     _jumpersFactory= new JumpersFactory(_fieldsGraph);
 }
Exemple #10
0
        public PhutballMoveScore Search(IFieldsGraph fieldsGraph)
        {
            var graphCopy    = (IFieldsGraph)fieldsGraph.Clone();
            var tree         = _movesFactory.GetMovesTree(graphCopy);
            var targetBorder = _playersState.CurrentPlayer.GetTargetBorder(fieldsGraph);

            var cuttoffVisitor = new CuttoffPickBestValueNodeVisitor(targetBorder, graphCopy, _playersState)
            {
                CuttoffToTargetBorder = CuttoffToTarget
            };
            var performMoves          = cuttoffVisitor.MovesPerformer;
            var depthCounter          = new DepthCounterNodeVisitor <JumpNode>();
            var stopOnMaxNodesVisited = new StopOnVisitedNodesCount <JumpNode>(MaxVisitedNodes);
            var searchNodeVisitor     = stopOnMaxNodesVisited
                                        .FollowedBy(cuttoffVisitor)
                                        .FollowedBy(depthCounter)
                                        .FollowedBy(_defaultNodeVistor);
            var search = _searchFactory(searchNodeVisitor, performMoves, targetBorder);

            search.Run(tree);
            return(new PhutballMoveScore(cuttoffVisitor.PickBestValue.ResultMove, cuttoffVisitor.PickBestValue.CurrentMaxValue)
            {
                VisitedNodesCount = stopOnMaxNodesVisited.VistedNodesCount,
                MaxDepth = depthCounter.MaxDepth,
                CuttoffsCount = cuttoffVisitor.CuttoffsCount
            });
        }
        public PhutballMoveScore Search(IFieldsGraph fieldsGraph)
        {
            if(_alphaBetaSearchDepth.SearchDepth == 0)
            {
                return PhutballMoveScore.Empty();
            }
            var actualGraph = (IFieldsGraph)fieldsGraph.Clone();
            var performMoves = new PerformMoves(actualGraph, _playersState);
            var visitedNodes = new VisitedNodesCounter<JumpNode>();
            _alphaBetaSearch = new AlphaBetaSearch<JumpNode>(
                new WhiteStoneToCurrentPlayerBorderDistance(_playersState, actualGraph, _alphaBetaSearchDepth.DistanceToBorderWeight)
                .Add(new BlackStoneToTargetBorderCount(_playersState, actualGraph, _alphaBetaSearchDepth.BlackStonesToBorderWeight))
                ,
                _alphaBetaSearchDepth,
                new PerformMovesNodeVisitor(performMoves).FollowedBy(visitedNodes)
            );

            var movesTree = _movesFactory(actualGraph);
            _alphaBetaSearch.Run(movesTree);
            var result = new CompositeMove();
            _alphaBetaSearch.BestMove.Move.MovesFromRoot.CollectToPlayerSwitch(result);
            return new PhutballMoveScore(result, _alphaBetaSearch.BestMove.Score)
                       {
                           CuttoffsCount = _alphaBetaSearch.CuttoffsCount,
                           VisitedNodesCount = visitedNodes.Count
                       };
        }
Exemple #12
0
        public IEnumerable <Tuple <int, int> > BottomIsTarget(IFieldsGraph fieldsGraph)
        {
            var coord = fieldsGraph.GetWhiteFieldCoords();

            return(_allBottom.SelectMany(MultiplyByRadius)
                   .Select(r => coord.Add(r)));
        }
        public IEnumerable<Tuple<int, int>> UpperIsTarget(IFieldsGraph fieldsGraph)
        {
            var coord = fieldsGraph.GetWhiteFieldCoords();

            return _allUpper.SelectMany(MultiplyByRadius)
                .Select(r=> coord.Add(r));
        }
Exemple #14
0
 public BestMoveApplier(IMoveFinders moveFinders, MovesHistory movesHistory, IFieldsGraph fieldsGraph, IPerformMoves performMoves, IEventPublisher eventPublisher)
 {
     _moveFinders    = moveFinders;
     _eventPublisher = eventPublisher;
     _performMoves   = performMoves;
     _movesHistory   = movesHistory;
     _fieldsGraph    = fieldsGraph;
 }
Exemple #15
0
 public IEnumerable <Tuple <int, int> > BottomIsTarget(IFieldsGraph fieldsGraph)
 {
     return(Direction.AllBottom.Take(5).Select(dir => _firstPosition.Add(dir))
            .Concat(new[] { _firstPosition })
            .Concat(_whiteCoords)
            .Concat(Direction.AllBottom.Take(3).SelectMany(
                        dir => _whiteCoords.Select(coord => coord.Add(dir)))));
 }
 public IEnumerable<Tuple<int, int>> UpperIsTarget(IFieldsGraph fieldsGraph)
 {
     return Direction.AllUpper.Take(5).Shuffle().Select(dir => _firstPosition.Add(dir))
         .Concat(new[]{_firstPosition})
         .Concat(_whiteCoords)
         .Concat(Direction.AllUpper.Take(3).SelectMany(
             dir => _whiteCoords.Select(coord => coord.Add(dir))));
 }
Exemple #17
0
        public static IFieldsGraph ShouldHaveWhiteFieldAt(this IFieldsGraph graph, int row, int column)
        {
            var whiteField = graph.GetWhiteField();

            whiteField.RowIndex.ShouldEqual(row, "Row should be {0} but was {1}");
            whiteField.ColumnIndex.ShouldEqual(column, "Column should be {0} but was {1}");
            return(graph);
        }
Exemple #18
0
        public WhiteStoneToCurrentPlayerBorderDistance(IPlayersState playersState, IFieldsGraph fieldsGraph, int distanceToBorderWeight)
        {
            _distanceToBorderWeight = distanceToBorderWeight;
            var currentPlayer = playersState.CurrentPlayer;

            _targetBorder = currentPlayer.GetTargetBorder(fieldsGraph);
            _whiteStoneToBorderDistance = new WhiteStoneToBorderDistanceValue(_targetBorder);
        }
 public BestMoveApplier(IMoveFinders moveFinders,  MovesHistory movesHistory, IFieldsGraph fieldsGraph, IPerformMoves performMoves, IEventPublisher eventPublisher)
 {
     _moveFinders = moveFinders;
     _eventPublisher = eventPublisher;
     _performMoves = performMoves;
     _movesHistory = movesHistory;
     _fieldsGraph = fieldsGraph;
 }
Exemple #20
0
 public PickBestValueNodeVisitor(TargetBorder targetBorder, IFieldsGraph graphCopy, IPerformMoves performMoves)
 {
     _targetBorder   = targetBorder;
     _valueOfGraph   = new WhiteStoneToBorderDistanceValue(targetBorder);
     _graphCopy      = graphCopy;
     _performMoves   = performMoves;
     CurrentMaxValue = _valueOfGraph.GetValue(_graphCopy);
     MaxUpdated     += () => { };
 }
 public PhutballMoveScore Search(IFieldsGraph fieldsGraph)
 {
     var result = _realStrategy.Search(fieldsGraph);
     if(result == null || result.Move == null)
     {
         return PhutballMoveScore.Empty();
     }
     return result.FollowedBy(new DeselectWhiteFieldIfSelectedMove());
 }
Exemple #22
0
 public PhutballBoard(
     IPlayersState playerState,
     IFieldsGraph fieldsGraph,
     IEventPublisher eventPublisher,
     IPhutballOptions options) : base(fieldsGraph, options)
 {
     _playerState    = playerState;
     _eventPublisher = eventPublisher;
 }
Exemple #23
0
        private void InitliazeBlackBuckets(IFieldsGraph fieldsGraph)
        {
            _bestWhiteStonePostion = fieldsGraph.GetWhiteField().RowIndex;
            var blackFields = fieldsGraph.GetBlackFields();

            _blackFields           = blackFields.ToHashSet();
            _blackFieldsByRowIndex = _fieldsGraph.RowCount.Times((row) => new { row, fields = new HashSet <Field>() })
                                     .ToDictionary(item => item.row, item => item.fields);
            blackFields.Each(field => _blackFieldsByRowIndex[field.RowIndex].Add(field));
        }
Exemple #24
0
 public CuttoffPickBestValueNodeVisitor(TargetBorder targetBorder, IFieldsGraph fieldsGraph, IPlayersState playersState)
 {
     _targetBorder  = targetBorder;
     _fieldsGraph   = fieldsGraph;
     MovesPerformer = new PerformMoves(this, playersState);
     PickBestValue  = new PickBestValueNodeVisitor(targetBorder, fieldsGraph, MovesPerformer);
     InitliazeBlackBuckets(fieldsGraph);
     PickBestValue.MaxUpdated += OnBestPositionUpdated;
     _targetBorderRowEndIndex  = _targetBorder.EndRowIndex;
 }
Exemple #25
0
        public PhutballMoveScore Search(IFieldsGraph fieldsGraph)
        {
            var result = _realStrategy.Search(fieldsGraph);

            if (result == null || result.Move == null)
            {
                return(PhutballMoveScore.Empty());
            }
            return(result.FollowedBy(new DeselectWhiteFieldIfSelectedMove()));
        }
Exemple #26
0
 public PhutballBoard(
     IPlayersState playerState,
     IFieldsGraph fieldsGraph,
     IEventPublisher eventPublisher,
     IPhutballOptions options)
     : base(fieldsGraph, options)
 {
     _playerState = playerState;
     _eventPublisher = eventPublisher;
 }
Exemple #27
0
 protected override IMoveFindingStartegy GetSearchEngine(IFieldsGraph graph)
 {
     options.AlphaBeta.JumpsMaxDepth             = 10;
     options.AlphaBeta.StoneRadius               = 1;
     options.AlphaBeta.SkipShortMoves            = 1;
     options.AlphaBeta.SearchDepth               = 3;
     options.AlphaBeta.BlackStonesToBorderWeight = 0;
     options.AlphaBeta.DistanceToBorderWeight    = 1;
     RawMoveFinders = new RawMoveFinders(new MovesFactory(), PlayersState.FirstIsOnTheMove(), options);
     return(RawMoveFinders.AlphaBeta());
 }
Exemple #28
0
        protected override void EstablishContext()
        {
            ProvideImplementationOf <IPhutballOptions>(new PhutballOptions
            {
                RowCount    = 7,
                ColumnCount = 5
            });
            _fieldsGraph = new FieldsGraph(Dependency <IPhutballOptions>());
            var whiteField = WhiteField();

            whiteField.PlaceWhiteStone();
            _fieldsGraph.UpdateFields(new[] { whiteField });
        }
Exemple #29
0
        protected override void EstablishContext()
        {
            _fieldsGraph  = GraphBuilder().Build();
            _playersState = PlayersState.SecondIsOnTheMove();
            _performMoves = new PerformMoves(_fieldsGraph, new NulloPlayersSwapper());
            var testPhutballOptions = new PhutballOptions
            {
                RowCount    = _fieldsGraph.RowCount,
                ColumnCount = _fieldsGraph.ColumnCount
            };

            _moveFinders = new RawMoveFinders(new MovesFactory(), _playersState, testPhutballOptions);
            ProvideImplementationOf <IPhutballOptions>(testPhutballOptions);
        }
 public int GetValue(IFieldsGraph valueSubject)
 {
     var whiteField = valueSubject.GetWhiteField();
     var rawDistance = _winingBorder.GetDistanceFrom(whiteField);
     if(rawDistance == 0)
     {
         return _winingBorder.WinValue;
     }
     var distanceBetweenBorders = DistanceBetweenBorders();
     if(rawDistance >= distanceBetweenBorders)
     {
         return _winingBorder.LooseValue;
     }
     return distanceBetweenBorders - rawDistance;
 }
        public TargetBorderEnum(IFieldsGraph fieldsGraph)
        {
            Upper = new TargetBorder(() => 1, UpperName)
                .OppositeIs(() => Bottom)
                .CountDistanceUsing(new DistanceToUpperBorderCounter(fieldsGraph))
                .ComparePositionsUsing((left,right)=> left < right)
                .EndRowIndexIs(me=> 1)
                .WiningIndexes((me)=> new[]{0,1});

            Bottom = new TargetBorder(() => fieldsGraph.RowCount - 2, Bottomname)
                .OppositeIs(() => Upper)
                .CountDistanceUsing(new DistanceToBottomBorderCounter(fieldsGraph))
                .EndRowIndexIs((me)=> me.RowIndex )
                .ComparePositionsUsing((left, right) => left > right)
                .WiningIndexes((me)=> new[]{me.RowIndex, me.RowIndex + 1});
        }
Exemple #32
0
        public TargetBorderEnum(IFieldsGraph fieldsGraph)
        {
            Upper = new TargetBorder(() => 1, UpperName)
                    .OppositeIs(() => Bottom)
                    .CountDistanceUsing(new DistanceToUpperBorderCounter(fieldsGraph))
                    .ComparePositionsUsing((left, right) => left < right)
                    .EndRowIndexIs(me => 1)
                    .WiningIndexes((me) => new[] { 0, 1 });

            Bottom = new TargetBorder(() => fieldsGraph.RowCount - 2, Bottomname)
                     .OppositeIs(() => Upper)
                     .CountDistanceUsing(new DistanceToBottomBorderCounter(fieldsGraph))
                     .EndRowIndexIs((me) => me.RowIndex)
                     .ComparePositionsUsing((left, right) => left > right)
                     .WiningIndexes((me) => new[] { me.RowIndex, me.RowIndex + 1 });
        }
Exemple #33
0
        public int GetValue(IFieldsGraph valueSubject)
        {
            var whiteField  = valueSubject.GetWhiteField();
            var rawDistance = _winingBorder.GetDistanceFrom(whiteField);

            if (rawDistance == 0)
            {
                return(_winingBorder.WinValue);
            }
            var distanceBetweenBorders = DistanceBetweenBorders();

            if (rawDistance >= distanceBetweenBorders)
            {
                return(_winingBorder.LooseValue);
            }
            return(distanceBetweenBorders - rawDistance);
        }
 public PhutballMoveScore Search(IFieldsGraph fieldsGraph)
 {
     var graphCopy = (IFieldsGraph)fieldsGraph.Clone();
     var tree = _movesFactory.GetMovesTree(graphCopy);
     var targetBorder = _playersState.CurrentPlayer.GetTargetBorder(fieldsGraph);
     var performMoves = new PerformMoves(graphCopy, _playersState);
     var bestValuePicker = new PickBestValueNodeVisitor(targetBorder, graphCopy, performMoves);
     var nodeCounter = new VisitedNodesCounter<JumpNode>();
     var depthCounter = new DepthCounterNodeVisitor<JumpNode>();
     var searchNodeVisitor = _defaultNodeVistor.FollowedBy(bestValuePicker).FollowedBy(nodeCounter).FollowedBy(depthCounter);
     var search = _searchFactory(searchNodeVisitor, performMoves, targetBorder);
     search.Run(tree);
     return new PhutballMoveScore( bestValuePicker.ResultMove, bestValuePicker.CurrentMaxValue)
                {
                    VisitedNodesCount = nodeCounter.Count,
                    MaxDepth = depthCounter.MaxDepth
                };
 }
Exemple #35
0
        public PhutballMoveScore Search(IFieldsGraph fieldsGraph)
        {
            var graphCopy         = (IFieldsGraph)fieldsGraph.Clone();
            var tree              = _movesFactory.GetMovesTree(graphCopy);
            var targetBorder      = _playersState.CurrentPlayer.GetTargetBorder(fieldsGraph);
            var performMoves      = new PerformMoves(graphCopy, _playersState);
            var bestValuePicker   = new PickBestValueNodeVisitor(targetBorder, graphCopy, performMoves);
            var nodeCounter       = new VisitedNodesCounter <JumpNode>();
            var depthCounter      = new DepthCounterNodeVisitor <JumpNode>();
            var searchNodeVisitor = _defaultNodeVistor.FollowedBy(bestValuePicker).FollowedBy(nodeCounter).FollowedBy(depthCounter);
            var search            = _searchFactory(searchNodeVisitor, performMoves, targetBorder);

            search.Run(tree);
            return(new PhutballMoveScore(bestValuePicker.ResultMove, bestValuePicker.CurrentMaxValue)
            {
                VisitedNodesCount = nodeCounter.Count,
                MaxDepth = depthCounter.MaxDepth
            });
        }
Exemple #36
0
 public TargetBorder GetTargetBorder(IFieldsGraph fieldsGraph)
 {
     return _targetBorderAccessor(fieldsGraph);
 }
Exemple #37
0
 public BoardJumpTree(IFieldsGraph actualGraph, IPhutballMove moveToApply, ITree <JumpNode> parent)
 {
     Parent          = parent;
     Node            = new JumpNode(actualGraph, moveToApply);
     _jumpersFactory = new JumpersFactory(actualGraph);
 }
 public PhutballMoveScore Search(IFieldsGraph fieldsGraph)
 {
     return _bruteForceSearch.Search(fieldsGraph);
 }
Exemple #39
0
 public RootedBySelectingWhiteFieldBoardJumpTree GetMovesTree(IFieldsGraph graphCopy)
 {
     return(new RootedBySelectingWhiteFieldBoardJumpTree(graphCopy));
 }
Exemple #40
0
 public FieldJump(IFieldsGraph fieldsGraph, Field from, Tuple<int, int> delta)
 {
     _fieldsGraph = fieldsGraph;
     _from = from;
     _delta = delta;
 }
Exemple #41
0
 public PhutballMoveScore Search(IFieldsGraph fieldsGraph)
 {
     return(_bruteForceSearch.Search(fieldsGraph));
 }
Exemple #42
0
 public static JumpNode Empty(IFieldsGraph graph)
 {
     return new JumpNode(graph, new EmptyPhutballMove());
 }
Exemple #43
0
 public JumpNode(IFieldsGraph sourceGraph, IPhutballMove moveToApply)
 {
     ActualGraph = sourceGraph;
     LastMove = moveToApply;
     MovesFromRoot = new EmptyPhutballMove();
 }
Exemple #44
0
 public DistanceToUpperBorderCounter(IFieldsGraph fieldsGraph)
 {
     _fieldsGraph = fieldsGraph;
 }
 public DistanceToBottomBorderCounter(IFieldsGraph fieldsGraph)
 {
     _fieldsGraph = fieldsGraph;
 }
Exemple #46
0
 protected override IMoveFindingStartegy GetSearchEngine(IFieldsGraph graph)
 {
     RawMoveFinders = new RawMoveFinders(new MovesFactory(), PlayersState.SecondIsOnTheMove(), options);
     return(RawMoveFinders.OrderByNodesValuesWithCuttofsToWhite());
 }
Exemple #47
0
 public RootedBySelectingWhiteFieldBoardJumpTree GetMovesTree(IFieldsGraph graphCopy)
 {
     return new RootedBySelectingWhiteFieldBoardJumpTree(graphCopy);
 }
Exemple #48
0
 public JumpersFactory(IFieldsGraph fieldsGraph)
 {
     _fieldsGraph = fieldsGraph;
 }
 public PlayerBlackStonePlacer(IFieldsGraph fieldsGraph, IPlayersState playersState)
 {
     _fieldsGraph = fieldsGraph;
     _playersState = playersState;
 }
Exemple #50
0
 public ReadOnlyPhutballBoard(IFieldsGraph fieldsGraph, IPhutballOptions options)
 {
     _fieldsGraph = fieldsGraph;
     _options     = options;
 }
Exemple #51
0
 public IEnumerable <Tuple <int, int> > BottomIsTarget(IFieldsGraph fieldsGraph)
 {
     return(_first.BottomIsTarget(fieldsGraph).Concat(_right.BottomIsTarget(fieldsGraph)));
 }
 public ReadOnlyPhutballBoard(IFieldsGraph fieldsGraph, IPhutballOptions options)
 {
     _fieldsGraph = fieldsGraph;
     _options = options;
 }
 public IEnumerable<Tuple<int, int>> UpperIsTarget(IFieldsGraph fieldsGraph)
 {
     return _first.UpperIsTarget(fieldsGraph).Concat(_right.UpperIsTarget(fieldsGraph));
 }
Exemple #54
0
 protected abstract IMoveFindingStartegy GetSearchEngine(IFieldsGraph graph);