public GameController() { gameInput = null; infoMessage = null; displayableGameModel = null; evaluator = null; gLoopThread = null; gameState = EGameControlState.PreInitial; }
/* Receives a value indicating a game model and sets up the model as 'displayableModel' (to which the view is bound) and also '*Model' (which is used in the game loop etc). This method also sets up any dependent utilities. */ public void InitialiseModel(EGameModels model, System.Windows.Forms.Form viewRef) { switch(model) { case EGameModels.Chess: displayableGameModel = new ChessPositionModel(); chessModel = (ChessPositionModel)displayableGameModel; evaluator = new Evaluator(); evaluator.ViewRef = viewRef; evaluator.GenerateRays(); evaluator.GeneratePawnRays(); break; case EGameModels.TicTacToe: displayableGameModel = new TicTacToePositionModel(); tictactoeModel = (TicTacToePositionModel)displayableGameModel; break; } gameState = EGameControlState.Initial; }
/* This takes a value indicating a gameModel and returns the values of the displayable and game models and utilities to null. */ public void UnInitialiseModel(EGameModels model) { switch(model) { case EGameModels.Chess: chessModel = null; evaluator = null; break; case EGameModels.TicTacToe: tictactoeModel = null; break; } displayableGameModel = null; gameState = EGameControlState.PreInitial; }
private void SelectItemComplete(IDisplayableModel model) { dialogCoordinator.HideMetroDialogAsync(this, CustomDialog); CurrentItemInDesign = model.GetNewDiplayInfo(); CanEditItem = true; }