public TwoZeroFourEightView()
 {
     InitializeComponent();
     model = new TwoZeroFourEightModel();
     model.AttachObserver(this);
     controller = new TwoZeroFourEightController();
     controller.AddModel(model);
     model.NotifyAll();
 }
 public TwoZeroFourEightView()
 {
     InitializeComponent();
     model = new TwoZeroFourEightModel();
     model.AttachObserver(this);
     controller = new TwoZeroFourEightController();
     controller.AddModel(model);
     controller.ActionPerformed(TwoZeroFourEightController.LEFT);
 }
 public TwoZeroFourEightView()
 {
     InitializeComponent();
     model = new TwoZeroFourEightModel();
     model.AttachObserver(this);
     controller = new TwoZeroFourEightController();
     controller.AddModel(model);
     controller.ActionPerformed(TwoZeroFourEightController.LEFT);
 }
 public TwoZeroFourEightView()
 {
     InitializeComponent();
     model = new TwoZeroFourEightModel();
     model.AttachObserver(this);
     controller = new TwoZeroFourEightController();
     controller.AddModel(model);
     controller.ActionPerformed(TwoZeroFourEightController.LEFT);
     textBox1.KeyDown += new KeyEventHandler(OnKeyDownHandler);
 }
Exemplo n.º 5
0
        public int sum; //add by me

        public TwoZeroFourEightView()
        {
            InitializeComponent();
            model = new TwoZeroFourEightModel();
            model.AttachObserver(this);
            controller = new TwoZeroFourEightController();
            controller.AddModel(model);
            controller.ActionPerformed(TwoZeroFourEightController.LEFT);
            labelGameOver.Visible = false;
            KeyPreview            = true;
        }
 public TwoZeroFourEightView()
 {
     InitializeComponent();
     model = new TwoZeroFourEightModel();
     model.AttachObserver(this);
     controller = new TwoZeroFourEightController();
     controller.AddModel(model);
     controller.ActionPerformed(TwoZeroFourEightController.LEFT);
     scoreView = new ShowScore(model);
     scoreView.Visible = true;
     scoreView.Enabled = true;
 }
 public TwoZeroFourEightView()
 {
     InitializeComponent();
     model = new TwoZeroFourEightModel();
     model.AttachObserver(this);
     controller = new TwoZeroFourEightController();
     controller.AddModel(model);
     controller.ActionPerformed(TwoZeroFourEightController.LEFT);
     // Form ScoreBoard = new Form();
     //ScoreBoard.IsMdiContainer = true;
     // ScoreBoard.Show();
 }
        TwoZeroFourEightScoreView scoreview; //สร้างสกอร์วิว

        #endregion Fields

        #region Constructors

        public TwoZeroFourEightView()
        {
            InitializeComponent();
            model = new TwoZeroFourEightModel();
            model.AttachObserver(this);
            controller = new TwoZeroFourEightController();
            controller.AddModel(model);
            controller.ActionPerformed(TwoZeroFourEightController.LEFT);
            scoreview = new TwoZeroFourEightScoreView(); //การสร้างสกอร์ ชี้ไปที่คลาส 2048
            scoreview.Visible = true;
            scoreview.Enabled = true;
        }
Exemplo n.º 9
0
        public TwoZeroFourEightView()
        {
            InitializeComponent();
            TextBox tb = new TextBox();

            this.Controls.Add(tb); // keyboard controll
            tb.KeyDown += new KeyEventHandler(Form1_KeyDown);
            model       = new TwoZeroFourEightModel();
            model.AttachObserver(this);
            controller = new TwoZeroFourEightController();
            controller.AddModel(model);
            controller.ActionPerformed(TwoZeroFourEightController.LEFT);
        }
Exemplo n.º 10
0
        public TwoZeroFourEightView()
        {
            KeyPreview = true;
            InitializeComponent();
            TextBox Text = new TextBox();

            this.Controls.Add(Text);
            model = new TwoZeroFourEightModel();
            model.AttachObserver(this);
            controller = new TwoZeroFourEightController();
            controller.AddModel(model);
            controller.ActionPerformed(TwoZeroFourEightController.LEFT);
        }
        public TwoZeroFourEightView()
        {
            InitializeComponent();
            model = new TwoZeroFourEightModel();
            model.AttachObserver(this);

            ScoreVeiw = new TwoZeroFourEightScoreView();
            ScoreVeiw.Visible = false;
            ScoreVeiw.Enabled = false;

            controller = new TwoZeroFourEightController();
            controller.AddModel(model);
            controller.ActionPerformed(TwoZeroFourEightController.LEFT);
        }
Exemplo n.º 12
0
 public TwoZeroFourEightView()
 {
     InitializeComponent();
     model = new TwoZeroFourEightModel();
     model.AttachObserver(this);
     model.AttachObserver(a);
     controller = new TwoZeroFourEightController();
     controller.AddModel(model);
     controller.ActionPerformed(TwoZeroFourEightController.LEFT);
        // a.Text = "TwoZeroFourEightScoreView";
     //a.Controls.Add(new Label() { Name = "lblScore" ,Text = "Hello"});
        // a.label1.Text = "Hello";
     a.Show();
 }
        public TwoZeroFourEightView()
        {
            InitializeComponent();
            model = new TwoZeroFourEightModel();
            model.AttachObserver(this);
            controller = new TwoZeroFourEightController();
            controller.AddModel(model);
            controller.ActionPerformed(TwoZeroFourEightController.LEFT);

            //kp = new KeyPressEventHandler(key_Press);
            //this.KeyPress += kp;
            // kd = new KeyEventHandler(key_Down);
            this.KeyDown += new KeyEventHandler(key_Down); // this works only when the control(form) has focus
            // you can also use anonymous EventHandler like this...
            // this.KeyPress += new KeyPressEventHandler(yourMethod);
        }
        public TwoZeroFourEightView()
        {
            InitializeComponent();
            model = new TwoZeroFourEightModel();
            model.AttachObserver(this);
            controller = new TwoZeroFourEightController();
            controller.AddModel(model);
            controller.ActionPerformed(TwoZeroFourEightController.LEFT);

            //kpeh = new KeyPressEventHandler(key_Press);
            // this.KeyPress += kpeh; //this works only when the contro (form) has focus

            keh           = new KeyEventHandler(key_Down);
            this.KeyDown += keh;   //this works only when the control (form) has focus

            // this.KeyPress += new KeyPressEventHandler(key_Press); //create object
        }
Exemplo n.º 15
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;*/
        }