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); }
public Board(BoardData data, BoardBehavior behavior, BoardNodeFactory nodeFactory) { BoardSize = data.BoardSize; this.nodeFactory = nodeFactory; Behavior = behavior; foreach (var nodeData in data.Nodes) { makeNode(nodeData); } }