示例#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();
        }
示例#2
0
 void saveNoTimer_Click()
 {
     timersPanelCalled = false;
     timerNoTimer.doSlideOutY();
     if (timeScheme != null)
     {
         timeScheme = null;
     }
     //timeScheme = new NoTimeScheme();
     timersPanel.setSubSavedTimeScheme(new NoTimeScheme());
 }
示例#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));
 }
示例#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));
 }
示例#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;
 }
示例#6
0
 public PanelTime(Game game, CompoundGameComponent parent, AbstractTimeScheme timeScheme) : base(game, parent, "Panels\\SideHandle", "Panels\\CompletePane", 10)
 {
     this.time = timeScheme;
     time.Start();
     LoadContent();
 }