public GameView(KolobocController colobocController) { gameSpeed = GameModel.gameSpeed; shootDelay = new System.Threading.Timer(AllowShooting, null, 0, gameSpeed * 15); this.colobocController = colobocController; InitializeComponent(); }
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); }
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); }