Ejemplo n.º 1
0
 void Awake()
 {
     if (_instance == null)
     {
         _instance = this;
         DontDestroyOnLoad(gameObject);
     }
     else if (_instance != this)
     {
         Destroy(gameObject);
     }
 }
Ejemplo n.º 2
0
 void RegisterPathStart(Tile tile)
 {
     if (!Military.HasAnyAvailableUnit(tile, Game.activeUserID))
     {
         path.Clear();
     }
     else
     {
         path.Clear();
         path.Enqueue(tile);
         lastItem       = tile;
         secondLastItem = null;
     }
 }
Ejemplo n.º 3
0
        public static void Initiative(Data.Participant participant)
        {
            var domain = Game.Map.Domain(participant.ID);

            Debug.Log(string.Format("Participant {0} ({1}) has {2} regions",
                                    participant.name, participant.ID, domain.Count));

            for (int i = 0, l = domain.Count; i < l; i++)
            {
                SetNewPopulation(domain[i].demographics);
                var tax = Tax(domain[i].demographics);
                if (tax > 0)
                {
                    Military.Construct(participant, domain[i], Data.MilitaryUnitType.Fodder, tax);
                }
                SetCivilianState(domain[i].demographics, tax);
            }
            Game.Step();
        }
Ejemplo n.º 4
0
        void enactStep()
        {
            var participant = participants[gameState.activeParticipant];

            Debug.Log("Enacting turn: " + participant.turn);
            switch (participant.turn)
            {
            case PlayerTurn.CivilSociety:
                CivilSociety.Initiative(participant);
                break;

            case PlayerTurn.Leader:
                Leader.Initiative(participant.leaderData);
                break;

            case PlayerTurn.MilitaryConstruction:
                Military.BuildUnits(participant);
                break;

            case PlayerTurn.MilitaryOrders:
                ParticipantController.CollectOrders(participant);
                break;

            case PlayerTurn.MilitaryActions:
                StartCoroutine(OrderLog.ExecuteOrders());
                //OrderLog.ClearAllOrders();
                //Game.Step();
                break;

            default:
                Debug.LogError(string.Format("Requesting to enact {0} on {1} which is not possible",
                                             participant.turn,
                                             participant.name));
                Game.Step();
                break;
            }
        }