示例#1
0
        public GameForm()
        {
            this.FormWidth = this.Width;
            this.FormHeight = this.Height;

            this.InitializeComponent();

            this.ProgresiveBarTimer = new Timer();
            this.ProgresiveBarTimer.Interval = TimeForPlayerTurn * 1000;
            this.ProgresiveBarTimer.Tick += this.ProgresiveBarTimerTick;

            this.updateControlsTimer.Start();
            this.updateControlsTimer.Interval = 2000;
            this.updateControlsTimer.Tick += this.UpdateControlsTick;

            this.InitializeControlsArrays();

            IRenderer renderer = new GuiRenderer(this);

            IInputHandlerer inputHandlerer = new GuiInputHandlerer(this);

            this.gameEngine = new GameEngine(renderer, inputHandlerer);

            try
            {
                this.gameEngine.GameInit();
            }
            catch (InputValueException ex)
            {
                renderer.ShowMessage(ex.Message);
            }
        }
示例#2
0
        public GameForm()
        {
            this.FormWidth  = this.Width;
            this.FormHeight = this.Height;

            this.InitializeComponent();

            this.ProgresiveBarTimer          = new Timer();
            this.ProgresiveBarTimer.Interval = TimeForPlayerTurn * 1000;
            this.ProgresiveBarTimer.Tick    += this.ProgresiveBarTimerTick;

            this.updateControlsTimer.Start();
            this.updateControlsTimer.Interval = 2000;
            this.updateControlsTimer.Tick    += this.UpdateControlsTick;

            this.InitializeControlsArrays();

            IRenderer renderer = new GuiRenderer(this);

            IInputHandlerer inputHandlerer = new GuiInputHandlerer(this);

            this.gameEngine = new GameEngine(renderer, inputHandlerer);

            try
            {
                this.gameEngine.GameInit();
            }
            catch (InputValueException ex)
            {
                renderer.ShowMessage(ex.Message);
            }
        }
示例#3
0
        private void SetupGamer()
        {
            this.player = new Gamer();
            var             form     = new GameForm();
            IRenderer       renderer = new GuiRenderer(form);
            IInputHandlerer handler  = new GuiInputHandlerer();

            this.engine = new GameEngine(renderer, handler);
        }