Exemplo n.º 1
0
 public static void ExecuteGameStateExit(GAMESTATE_ENUM gameState)
 {
     if (IsGameStateValid(gameState) && ((GameStateTab[(int)gameState].gameStateExit) != null))
     {
         (GameStateTab[(int)gameState].gameStateExit)();
     }
 }
Exemplo n.º 2
0
 public static void ExecuteGameStateUpdate(GAMESTATE_ENUM gameState, float dt)
 {
     if (IsGameStateValid(gameState) && ((GameStateTab[(int)gameState].gameStateUpdate) != null))
     {
         (GameStateTab[(int)gameState].gameStateUpdate)(dt);
     }
 }
Exemplo n.º 3
0
 public static bool IsGameStateSpecial(GAMESTATE_ENUM gameState)
 {
     if (gameState == GAMESTATE_ENUM.GsRestart || gameState == GAMESTATE_ENUM.GsQuit)
     {
         return(true);
     }
     return(false);
 }
Exemplo n.º 4
0
        public static bool IsGameStateValid(GAMESTATE_ENUM gameState)
        {
            if ((0 <= gameState) && (gameState < GAMESTATE_ENUM.GsMax))
            {
                return(true);
            }

            return(false);
        }
Exemplo n.º 5
0
 //Function to change the game state to the next state
 public static void SetNextState(GAMESTATE_ENUM nextGameState)
 {
     if (IsGameStateValid(nextGameState) || IsGameStateSpecial(nextGameState))
     {
         gameStateIndices.next = nextGameState;
     }
     else
     {
     }
 }
 private void stateSetInit()
 {
     // 状態遷移を管理する関数を作る
     state_index = GAMESTATE_ENUM.INITIALIZE;
     state_timer = 0;
     GameState[(int)GAMESTATE_ENUM.INITIALIZE] = stateInitialize;
     GameState[(int)GAMESTATE_ENUM.TITLE] = stateTitle;
     GameState[(int)GAMESTATE_ENUM.TUTORIAL] = stateTutorial;
     GameState[(int)GAMESTATE_ENUM.PLAYING] = statePlaying;
     GameState[(int)GAMESTATE_ENUM.RESULT] = stateResult;
     GameState[(int)GAMESTATE_ENUM.RUNKING] = stateRunking;
 }
 private void stateNext(GAMESTATE_ENUM gse)
 {
     state_index = gse;
     state_timer = 0;
 }