예제 #1
0
        internal static void NewGame(int NewGameType)
        {
            AI.StopAI(); // The AI may not interfere with a new game.

            GameType = NewGameType;
            CurrentGame = new Game();
            LocalPlayerSide = false;

            if (GameType == GAMETYPE_INTERNETJOIN ||
                GameType == GAMETYPE_INTERNETHOST)
            {
                CurrentGame.GameResult = GAMERESULT_WAITFORCONNECTION;
                return;
            }

            if (GameType != GAMETYPE_HOTSEAT && GameType != GAMETYPE_AIONLY)
            {
                // Randomize who you are.
                LocalPlayerSide = DieRoll(0, 1) == 1 ? TURN_LIGHT : TURN_DARK;
            }

            MainForm.UpdateHistoryButtons();
            Engine.SetSpotLight();

            if ((GameType == GAMETYPE_SINGLEPLAYER &&
               LocalPlayerSide == TURN_DARK) || GameType == GAMETYPE_AIONLY)
                AI.StartAI();
        }
예제 #2
0
 internal static Game GetStateCopy(Game ToCopy)
 {
     Game NewGame = new Game();
     NewGame.GameState = (byte[])ToCopy.GameState.Clone();
     NewGame.CurrentTurn = ToCopy.CurrentTurn;
     return NewGame;
 }