Example #1
0
        public ActionScene(Game game, System.Type type, AbstractTimeScheme abstractTimeScheme, string p1Name, string p2Name)
            : base(game)
        {
            graphics = (GraphicsDeviceManager)Game.Services.GetService(typeof(GraphicsDeviceManager));
            if (highSetting)
            {
                graphics.PreferMultiSampling = true;
            }
            //   graphics.PreparingDeviceSettings += new EventHandler<PreparingDeviceSettingsEventArgs>(graphics_PreparingDeviceSettings);
            // graphics.IsFullScreen = true;
            graphics.ApplyChanges();


            Utilities.GameManager.resetReference();
            Utilities.GameManager.getReference(Game).setPlayerOneName(p1Name);
            Utilities.GameManager.getReference(Game).setPlayerTwoName(p2Name);
            if (type == typeof(BasicChessboardFactory))
            {
                chessboardFactory = new BasicChessboardFactory(Game, "GameLogic/gameLayout.xml");
            }

            isBlocked = false;

            this.abstractTimeScheme = abstractTimeScheme;

            //Reset the GameManager

            //Reset the History
            History.resetReference();
            curKeyState = oldKeyState = Keyboard.GetState();
            setChessboard();
        }
Example #2
0
 void saveNoTimer_Click()
 {
     timersPanelCalled = false;
     timerNoTimer.doSlideOutY();
     if (timeScheme != null)
     {
         timeScheme = null;
     }
     //timeScheme = new NoTimeScheme();
     timersPanel.setSubSavedTimeScheme(new NoTimeScheme());
 }
Example #3
0
 void saveHourglassPanel_Click()
 {
     timerHourGlassPanel.numberBox.OldText = timerHourGlassPanel.numberBox.Text;
     timersPanelCalled = false;
     timerHourGlassPanel.doSlideOutY();
     if (timeScheme != null)
     {
         timeScheme = null;
     }
     //timeScheme = new HourglassTimeScheme(Convert.ToInt32(timerCountDownPanel.numberBox.Text) * 60);
     timersPanel.setSubSavedTimeScheme(new HourglassTimeScheme(Convert.ToInt32(timerCountDownPanel.numberBox.Text) * 60));
 }
Example #4
0
 void saveFischerPanel_Click()
 {
     timerFischerPanel.numberBox.OldText  = timerFischerPanel.numberBox.Text;
     timerFischerPanel.numberBox2.OldText = timerFischerPanel.numberBox2.Text;
     timersPanelCalled = false;
     timerFischerPanel.doSlideOutY();
     if (timeScheme != null)
     {
         timeScheme = null;
     }
     timersPanel.setSubSavedTimeScheme(timeScheme = new FischerTimeScheme(Convert.ToInt32(timerFischerPanel.numberBox.OldText) * 60,
                                                                          Convert.ToInt32(timerFischerPanel.numberBox.Text)));
     //timeScheme = new FischerTimeScheme(Convert.ToInt32(timerFischerPanel.numberBox.OldText) * 60,
     //    Convert.ToInt32(timerFischerPanel.numberBox.Text));
     //Console.WriteLine("Hello, Fischer: " +
     //   Convert.ToInt32(timerFischerPanel.numberBox.OldText) * 60 +
     //   Convert.ToInt32(timerFischerPanel.numberBox.Text));
 }
Example #5
0
 /// <summary>
 /// When "save" button pressed in a sub-menu, modify the subSaved. i.e. Create a semi-saved state.
 /// </summary>
 /// <param name="timeScheme">The new time scheme saved by the user</param>
 public void setSubSavedTimeScheme(AbstractTimeScheme timeScheme)
 {
     subSavedTimeScheme = timeScheme;
 }
Example #6
0
 public PanelTime(Game game, CompoundGameComponent parent, AbstractTimeScheme timeScheme) : base(game, parent, "Panels\\SideHandle", "Panels\\CompletePane", 10)
 {
     this.time = timeScheme;
     time.Start();
     LoadContent();
 }