示例#1
0
 public ControllerMainWindow(int fieldSize, int ammountOfTanks, int ammountOfApples, int gameSpeed)
 {
     InitializeComponent();
     gameModel        = new GameModel(fieldSize, ammountOfTanks, ammountOfApples, gameSpeed);
     kolobokModel     = new KolobocModel();
     kolobokConroller = new KolobocController(kolobokModel);
     gameView         = new GameView(kolobokConroller);
     gameView.Width   = fieldSize;
     gameView.Height  = fieldSize;
     this.Controls.Add(gameView);
     SetOtherFormObjectPosition(fieldSize);
 }
示例#2
0
 private void btnNewGame_Click(object sender, EventArgs e) //???
 {
     gameModel.DestroyAll();
     this.Controls.Remove(gameView);
     gameModel        = new GameModel(GameModel.fieldSize, GameModel.ammountOfTanks, GameModel.ammountOfApples, GameModel.gameSpeed);
     kolobokModel     = new KolobocModel();
     kolobokConroller = new KolobocController(kolobokModel);
     gameView         = new GameView(kolobokConroller);
     gameView.Width   = GameModel.fieldSize;
     gameView.Height  = GameModel.fieldSize;
     this.Controls.Add(gameView);
     SetOtherFormObjectPosition(GameModel.fieldSize);
 }
示例#3
0
 public KolobocController(KolobocModel kolobokModel)
 {
     this.kolobokModel = kolobokModel;
 }