Exemplo n.º 1
0
 public GameController()
 {
     gameInput = null;
     infoMessage = null;
     displayableGameModel = null;
     evaluator = null;
     gLoopThread = null;
     gameState = EGameControlState.PreInitial;
 }
Exemplo n.º 2
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;
 }
Exemplo n.º 3
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;
 }