示例#1
0
        public void turnTick()
        {
            turn += 1;

            lastTurnTime = UnityEngine.Time.fixedTime;
            turnMessages.Clear();
            //eventManager.turnTick();
            //overmind.turnTick();
            //panic.turnTick();


            //Then grid cells
            for (int i = 0; i < sx; i++)
            {
                for (int j = 0; j < sy; j++)
                {
                    grid[i][j].turnTick();
                }
            }

            //Wars
            processWars();
            //Map events
            processMapEvents();

            //Finally societies
            //Use a duplication list so they can modify the primary society list (primarly adding a child soc)
            List <SocialGroup> duplicate = new List <SocialGroup>();

            foreach (SocialGroup group in socialGroups)
            {
                duplicate.Add(group);
            }
            foreach (SocialGroup group in duplicate)
            {
                group.turnTick();
            }

            List <SocialGroup> rems = new List <SocialGroup>();

            foreach (SocialGroup group in socialGroups)
            {
                if (group.checkIsGone())
                {
                    rems.Add(group);
                }
                else
                {
                    recomputeInformationAvailability(group);
                }
            }
            foreach (SocialGroup g in rems)
            {
                socialGroups.Remove(g);
            }

            overmind.turnTick();
            stats.turnTick(this);
            addEnthralledNextTurnMessages();
        }
示例#2
0
        public void turnTick()
        {
            turn += 1;
            //World.log("Turn " + turn);

            lastTurnTime = UnityEngine.Time.fixedTime;
            turnMessages.Clear();
            //eventManager.turnTick();
            //overmind.turnTick();
            //panic.turnTick();

            worldPanic = overmind.computeWorldPanic(new List <ReasonMsg>());

            //Then grid cells
            for (int i = 0; i < sx; i++)
            {
                for (int j = 0; j < sy; j++)
                {
                    grid[i][j].turnTick();
                }
            }

            processUnits();
            processWars();
            processAwareness();
            //processMapEvents();


            //Finally societies
            //Use a duplication list so they can modify the primary society list (primarly adding a child soc)
            List <SocialGroup> duplicate = new List <SocialGroup>();

            foreach (SocialGroup group in socialGroups)
            {
                duplicate.Add(group);
            }
            foreach (SocialGroup group in duplicate)
            {
                group.turnTick();
            }

            List <SocialGroup> rems = new List <SocialGroup>();

            foreach (SocialGroup group in socialGroups)
            {
                if (group is SG_AgentLight)
                {
                    continue;
                }
                if (group is SG_AgentDark)
                {
                    continue;
                }
                if (group.checkIsGone())
                {
                    rems.Add(group);
                }
                else
                {
                    recomputeInformationAvailability(group);
                }
            }
            foreach (SocialGroup g in rems)
            {
                socialGroups.Remove(g);
            }

            overmind.turnTick();
            stats.turnTick();
            addEnthralledNextTurnMessages();
            assignTerrainFromClimate();
        }