示例#1
0
 public GameController()
 {
     gameInput = null;
     infoMessage = null;
     displayableGameModel = null;
     evaluator = null;
     gLoopThread = null;
     gameState = EGameControlState.PreInitial;
 }
示例#2
0
 /* 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;
 }
示例#3
0
 /* 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;
 }
示例#4
0
 private void SelectItemComplete(IDisplayableModel model)
 {
     dialogCoordinator.HideMetroDialogAsync(this, CustomDialog);
     CurrentItemInDesign = model.GetNewDiplayInfo();
     CanEditItem         = true;
 }