Beispiel #1
0
        public Controller(Game game, iSubject game_observer)
        {
            this.game_model = game;
            //form_view.count[0]=new int();
            //form_view.count[1] = new int();
            form_view = new Form1(this, game);
            game_observer.registerObserver(form_view);

            Application.EnableVisualStyles();
            //Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(form_view);
        }
Beispiel #2
0
        public Form1(Controller _contoller, Game _game)
        {
            timer           = new System.Timers.Timer();
            timer.Interval  = 600;
            timer.Elapsed  += Time;
            timer.AutoReset = true;

            controller = _contoller;
            game       = _game;
            InitializeComponent();
            this.KeyPreview = true;
            this.KeyDown   += new KeyEventHandler(OnKeyDown);
        }