//-- factories internal static ChoiceMaker Create(BoardModel board, ChooserKinds kind, int steps, int depth) { return(new ChoiceMaker { _choice = Choice.Create(board), _kind = kind, StepCount = steps, MaxDepth = depth, }); }
internal void NewBoard(ChooserKinds chooserkind, int stepcount, int maxdepth) { _states = new List <GameState>(); _redostates = new List <GameState>(); var board = CreateBoard(); // always start with default values from game def, but should change before update var chooser = ChoiceMaker.Create(board, chooserkind, stepcount, maxdepth); AddState(chooser); Status = GameStatusKinds.Ready; }
internal int _maxdepth; // max depth (for new board) //-- factories // create a game model with board & setup internal static GameModel Create(GameDef gamedef, ChooserKinds chooserkind = ChooserKinds.Mcts) { var gm = new GameModel { Def = gamedef, Rng = new Random(), _gamecode = gamedef.Code, _chooserkind = chooserkind, _stepcount = 10, // unuseful defaults _maxdepth = 2, }; gm.NewBoard(); return(gm); }
// start a new game with chooser and params public void NewBoard(ChooserKinds chooserkind, int stepcount, int maxdepth) { _gamemodel.NewBoard(chooserkind, stepcount, maxdepth); }