Inheritance: System.Windows.Forms.Form
示例#1
0
        public GameManager(MainWindow win, Panel drawingZone, GameParameters parameters)
        {
            _params         = parameters;
            _tmrMoveBlocks  = new System.Windows.Forms.Timer();
              //      _tmrDrinkUp     = new System.Windows.Forms.Timer();
              //      _tmrDrink       = new System.Windows.Forms.Timer();
            _blinkerTimer = new System.Windows.Forms.Timer();
            _tmrPump        = new System.Windows.Forms.Timer();
            _tmrPump.Tick   += new EventHandler(stopBlinker);

            _stacker = new Stacker(_params, _columnsQty);
            _win            = win;

            _pump1          = new Pump(Pump.ID.PUMP1);
            _pump2          = new Pump(Pump.ID.PUMP2);

            _messageQueue = new ScreenMessageQueue();

            _speedUpMsg = new ScreenMessage(_win, "Speed Up !", _messageQueue);
            _drinkMsg   = new ScreenMessage(_win, "You Drink !", _messageQueue);

            _speedUpMsg.TextColor = Color.Orange;
            _speedUpMsg.TextColor = Color.MediumPurple;

            initDrawingZone(drawingZone);

            _tmrMoveBlocks.Tick += new EventHandler(moveBlocks);
            _tmrPump.Tick       += new EventHandler(turnOffPump);
        }
示例#2
0
 public void Push(ScreenMessage msg)
 {
     _queue.Enqueue(msg);
     if (!_messageInProgress)
     {
         _queue.Peek().Go();
         _messageInProgress = true;
     }
 }