void StartResourceProductions() { for (int i = 0; i < this.kingdoms.Count; i++) { for (int j = 0; j < this.kingdoms [i].kingdom.cities.Count; j++) { this.kingdoms[i].kingdom.cities[j].SetCityAsActiveAndSetProduction(); // this.kingdoms [i].kingdom.cities [j].hexTile.isOccupied = true; } } turnEnded += TriggerCooperateEvents; turnEnded += CheckCooperateEvents; turnEnded += GeneralAI.TriggerCheckTask; turnEnded += GeneralAI.TriggerMove; for (int i = 0; i < this.kingdoms.Count; i++) { for (int j = 0; j < this.kingdoms [i].kingdom.cities.Count; j++) { turnEnded += this.kingdoms[i].kingdom.cities[j].CheckVisitingGenerals; } } ActivateProducationCycle(); }
public void EndTurn() { if (isDayPaused) { return; } turnEnded(this.currentDay); if (this.kingdoms.Count > 0) { for (int i = 0; i < this.kingdoms.Count; i++) { for (int j = 0; j < this.kingdoms[i].kingdom.lord.relationshipLords.Count; j++) { if (this.kingdoms[i].kingdom.lord.relationshipLords[j].lord.kingdom.cities.Count <= 0) { this.kingdoms [i].kingdom.lord.relationshipLords.RemoveAt(j); j--; } } } for (int i = 0; i < this.kingdoms.Count; i++) { if (this.kingdoms[i].kingdom.cities.Count <= 0) { this.kingdoms [i].kingdom.isDead = true; turnEnded -= this.kingdoms [i].TurnActions; Destroy(this.kingdoms [i].gameObject); this.kingdoms.RemoveAt(i); i--; } else { } } } if ((this.currentDay % 500) == 0) { Debug.Log("-----------------500 DAYS!------------------"); Debug.Log("TRADE COUNT: " + Utilities.tradeCount); Debug.Log("HELP COUNT: " + Utilities.helpCount); Debug.Log("GIFT COUNT: " + Utilities.giftCount); Debug.Log("COOPERATE 1 COUNT: " + Utilities.cooperate1Count); Debug.Log("COOPERATE 2 COUNT: " + Utilities.cooperate2Count); } // for (int i = 0; i < this.kingdoms.Count; i++) { // for (int j = 0; j < this.kingdoms [i].kingdom.cities.Count; j++) { // if (currentDay % 7 == 0) { //Select a new Citizen to create(Only occurs every 7 days) // this.kingdoms [i].kingdom.cities [j].cityAttributes.SelectCitizenForCreation(true); //assign citizen type to the City's newCitizenTarget // } // //// if(kingdoms [i].kingdom.cities [j].cityAttributes.upgradeCitizenTarget == null){ //// kingdoms [i].kingdom.cities [j].cityAttributes.SelectCitizenToUpgrade(); //// } // // } // } }
void Start() { disabledPlayers = 0; CreateBaseBoard(); CreateBotPosition(); AddHazards(); StartCoroutine(Initialization()); turnStarted += uiManager.turnStart; gameStarted += uiManager.gameStart; turnEnded += uiManager.turnEnd; }
public KingdomTest CreateNewKingdom(List <CityTileTest> cities, Color kingdomColor) { GameObject goKingdom = (GameObject)GameObject.Instantiate(kingdomTilePrefab); goKingdom.transform.parent = kingdomsParent.transform; goKingdom.GetComponent <KingdomTileTest>().CreateKingdom(5f, RACE.ELVES, cities, kingdomColor); goKingdom.name = goKingdom.GetComponent <KingdomTileTest> ().kingdom.kingdomName; this.kingdoms.Add(goKingdom.GetComponent <KingdomTileTest>()); this.turnEnded += goKingdom.GetComponent <KingdomTileTest> ().kingdom.CheckForWars; return(goKingdom.GetComponent <KingdomTileTest>().kingdom); }
void Start() { turnEnded += IncrementDaysOnTurn; turnEnded += WaitForHarvest; MapGenerator(); GenerateCities(); GenerateBiomes(); GenerateInitialKingdoms(); CreateInitialRelationshipsToLords(); // AssignCitiesToKingdoms(); GenerateCityConnections(); UpdateLordAdjacency(); // GenerateInitialCitizens (); StartResourceProductions(); UserInterfaceManager.Instance.SetCityInfoToShow(this.cities [0].GetComponent <CityTileTest> ()); }