public override void Reset() { this.myEmpireDepartmentOfPlanificationAndDevelopment = base.Empire.GetAgency <DepartmentOfPlanificationAndDevelopment>(); this.theirEmpireDepartmentOfPlanificationAndDevelopment = base.EmpireWhichReceives.GetAgency <DepartmentOfPlanificationAndDevelopment>(); this.myEmpireDepartmentOfScience = base.Empire.GetAgency <DepartmentOfScience>(); this.theirEmpireDepartmentOfScience = base.EmpireWhichReceives.GetAgency <DepartmentOfScience>(); Diagnostics.Assert(this.myEmpireDepartmentOfPlanificationAndDevelopment != null); Diagnostics.Assert(this.theirEmpireDepartmentOfPlanificationAndDevelopment != null); Diagnostics.Assert(this.myEmpireDepartmentOfScience != null); Diagnostics.Assert(this.theirEmpireDepartmentOfScience != null); this.warAgent = base.ParentGroup.GetAgent(AILayer_DiplomacyAmas.AgentNames.WarTermAgent); AgentGroupPath agentGroupPath = new AgentGroupPath("../DiplomacyEvaluationAmas"); this.globalWarAgent = agentGroupPath.GetFirstValidatedAgent(base.ParentGroup, "GlobalWarAgent"); if (this.warAgent == null || this.globalWarAgent == null) { base.Enable = false; return; } base.Reset(); if (!base.Enable) { return; } }
public override void Reset() { base.Reset(); if (!base.Enable) { return; } if (this.departmentOfTheInterior == null) { Diagnostics.LogError("The agent {0} can't get the department of interior.", new object[] { base.Name }); base.Enable = false; return; } Agent[] validatedAgents = new AgentGroupPath("ResourceEvaluationAmas/CityAgentGroup").GetValidatedAgents(base.ParentGroup, "NetCityMoney"); SimulationNormalizedAgent[] array; if (validatedAgents != null) { array = Array.ConvertAll <Agent, SimulationNormalizedAgent>(validatedAgents, (Agent agent) => agent as SimulationNormalizedAgent); } else { array = new SimulationNormalizedAgent[0]; } this.netCityMoneyAgents = array; Diagnostics.Assert(this.netCityMoneyAgents != null); AIEntity_Empire entity = (base.ContextObject as AIPlayer_MajorEmpire).GetEntity <AIEntity_Empire>(); this.aILayer_Victory = entity.GetLayer <AILayer_Victory>(); }