public TwoZeroFourEightView() { InitializeComponent(); model = new TwoZeroFourEightModel(); model.AttachObserver(this); controller = new TwoZeroFourEightController(); controller.AddModel(model); controller.ActionPerformed(TwoZeroFourEightController.LEFT); }
public void Notify(Model m) { TwoZeroFourEightModel tmp = (TwoZeroFourEightModel)m; UpdateScore(tmp.GetScore()); UpdateBoard(tmp.GetBoard()); if (tmp.isFinish()) { n(); } }
public TwoZeroFourEightView() { InitializeComponent(); this.BackColor = Color.FromArgb(115, 220, 235); model = new TwoZeroFourEightModel(); model2048 = new TwoZeroFourEightModel(); model.AttachObserver(this); controller = new TwoZeroFourEightController(); controller.AddModel(model); controller.ActionPerformed(TwoZeroFourEightController.LEFT); /*this.Focus(); * kpeh = new KeyPressEventHandler(key_Press); * this.KeyPress += kpeh; * * keh = new KeyEventHandler(key_Down); * this.KeyDown += keh;*/ }