Ejemplo n.º 1
0
 public static void advanceGamePhase()
 {
     refillTurnOrder();
     if (gamePhase == MyEnum.GamePhase.adminstration)
     {
         gamePhase = MyEnum.GamePhase.trade;
     }
     if (gamePhase == MyEnum.GamePhase.trade)
     {
         gamePhase = MyEnum.GamePhase.auction;
     }
     if (gamePhase == MyEnum.GamePhase.auction)
     {
         gamePhase = MyEnum.GamePhase.movement;
     }
     if (gamePhase == MyEnum.GamePhase.movement)
     {
         // turn += 1;
         gamePhase = MyEnum.GamePhase.end;
     }
     if (gamePhase == MyEnum.GamePhase.end)
     {
         // turn += 1;
         gamePhase = MyEnum.GamePhase.adminstration;
     }
 }
Ejemplo n.º 2
0
    public MyEnum.GamePhase ProcessTurn()
    {
        MyEnum.GamePhase phase = State.GetPhase();
        Debug.Log("Current Phase: " + State.GetPhase().ToString());


        if (State.currentPlayer < State.getNations().Count)
        {
            App    app           = UnityEngine.Object.FindObjectOfType <App>();
            int    humanIndex    = app.GetHumanIndex();
            Nation human         = State.getNations()[humanIndex];
            Nation currentPlayer = State.getNextPlayer();
            Debug.Log("Current Player is " + currentPlayer.getNationName());
            if (currentPlayer.getIndex() == humanIndex && phase != MyEnum.GamePhase.trade)
            {
                Debug.Log("Player is Human");
                return(phase);
            }
            else
            {
                Debug.Log("Player is AI");
                if (phase == MyEnum.GamePhase.adminstration)
                {
                    currentPlayer.getAI().processAdminstrationPhase(currentPlayer);
                    //EarlyGameAdminstration.mainEarlyAdminLoop(currentPlayer);
                    currentPlayer = State.getNextPlayer();
                }
                else if (phase == MyEnum.GamePhase.trade)
                {
                    //  State.getTradeHandler().handleTrades();
                    currentPlayer = State.getNextPlayer();
                    return(phase);
                }
                else if (phase == MyEnum.GamePhase.auction)
                {
                    // acutionControlFlow(currentPlayer, phase);
                    //currentPlayer = State.getNextPlayer();
                }
                else if (phase == MyEnum.GamePhase.events)
                {
                    updateGameMap();
                    if (currentPlayer.getIndex() == humanIndex)
                    {
                        return(phase);
                    }
                    else
                    {
                        currentPlayer.getAI().processMovements();
                        currentPlayer = State.getNextPlayer();
                    }
                }
                else if (phase == MyEnum.GamePhase.end)
                {
                    State.advanceGamePhase();
                    return(phase);
                }
            }
        }
        else
        {
            State.advanceGamePhase();
            if (State.GetPhase() == MyEnum.GamePhase.adminstration)
            {
                //  State.TurnIncrement();
                // State.refillTurnOrder();
                State.setCurrentPlayer(0);
            }
            //State.setCurrentTurnOrderIndex(0);
            return(phase);
        }
        return(phase);
    }
Ejemplo n.º 3
0
 public static void setGamePhase(MyEnum.GamePhase phase)
 {
     gamePhase = phase;
 }