Ejemplo n.º 1
0
        public static Game ApplyMove(this Game game, Move move, MoveApplicationStrategy moveApplicationStrategy)
        {
            Debug.Assert(game?.Current != null);
            var postMoveBoardNode = BoardNodeFactory.ApplyMoveToBoard(game.Current, move);

            game.Current.Node.AddNode(postMoveBoardNode.Node);
            game.Current = postMoveBoardNode;
            return(game);
        }
Ejemplo n.º 2
0
 public Board(BoardData data, BoardBehavior behavior, BoardNodeFactory nodeFactory)
 {
     BoardSize        = data.BoardSize;
     this.nodeFactory = nodeFactory;
     Behavior         = behavior;
     foreach (var nodeData in data.Nodes)
     {
         makeNode(nodeData);
     }
 }