예제 #1
0
 public TwoZeroFourEightView()
 {
     InitializeComponent();
     model = new TwoZeroFourEightModel();
     model.AttachObserver(this);
     controller = new TwoZeroFourEightController();
     controller.AddModel(model);
     controller.ActionPerformed(TwoZeroFourEightController.LEFT);
 }
예제 #2
0
        public void Notify(Model m)
        {
            TwoZeroFourEightModel tmp = (TwoZeroFourEightModel)m;

            UpdateScore(tmp.GetScore());
            UpdateBoard(tmp.GetBoard());
            if (tmp.isFinish())
            {
                n();
            }
        }
예제 #3
0
        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;*/
        }