public StateAI(State state) { Data = state; autoBuilder = new AutoBuilder(this); autoReasercher = new AutoReasercher(this); autoTrader = new AutoTrader(this); autoRegimentBuilder = new AutoRegimentBuilder(this); autoArmyCommander = new AutoArmyCommander(this); autoPersonControl = new AutoPersonControl(this); autoDiplomacy = new AutoDiplomacy(this); buildAndregimentsManager = new AutoSpenderManager((autoBuilder, 50), (autoRegimentBuilder, 35)); scienceManager = new AutoSpenderManager((autoReasercher, 10)); }
public void Occupated(Region r, State occupant) { r.Destoyed = false; State realOwner = r.owner; State curOwner = r.curOwner; if (occupant != r.owner) { r.ocptby = occupant; Debug.Log(string.Format("Страна {0} захватила {1}", occupant.name, r.name)); } else { r.ocptby = null; Debug.Log(string.Format("Страна {0} вернула {1}", occupant.name, r.name)); } if (realOwner.stateAI.autoArmyCommander.IsOn) { realOwner.stateAI.autoArmyCommander.RecalculateRegions(); } AutoArmyCommander autoArmy = realOwner.stateAI.autoArmyCommander; if (autoArmy.IsOn) { autoArmy.RecalculateRegions(); } if (!r.InFogFrom(curPlayer)) { MapMetrics.SetRegionSplatState(r.territory, LandShowMode.Visible); } MapMetrics.UpdateOccupedMap(); MapMetrics.UpdateSplatMap(); }