public void ChangeFaction(Faction faction) { this.ResetAuto(); if ((faction != null) && base.Scenario.IsPlayer(faction)) { this.AutoHiring = true; this.AutoRewarding = true; } if ((faction != null) && (this.BelongedFaction != null)) { this.BelongedFaction.Architectures.Remove(this); this.BelongedFaction.RemoveArchitectureKnownData(this); if (!base.Scenario.IsPlayer(this.BelongedFaction)) { this.ClearRouteways(); } else { foreach (Routeway routeway in this.Routeways) { this.BelongedFaction.RemoveRouteway(routeway); } } foreach (Military military in this.Militaries) { this.BelongedFaction.RemoveMilitary(military); } this.PurifyFactionInfluences(); this.BelongedFaction = null; faction.AddArchitecture(this); faction.AddArchitectureKnownData(this); foreach (Captive captive in this.Captives.GetList()) { if (captive.CaptiveFaction == faction) { captive.CaptivePerson.Status = PersonStatus.Normal; captive.CaptivePerson.BelongedCaptive = null; } } foreach (Military military in this.Militaries) { faction.AddMilitary(military); } foreach (Routeway routeway in this.Routeways) { faction.AddRouteway(routeway); } faction.FirstSection.AddArchitecture(this); this.ApplyFactionInfluences(); } if (faction != null) { //this.jianzhuqizi.qizidezi.Text = faction.ToString().Substring(0, 1); } }
public void ChangeFaction(Faction faction) { this.ResetAuto(); if ((faction != null) && base.Scenario.IsPlayer(faction)) { this.AutoHiring = true; this.AutoRewarding = true; } if ((faction != null) && (this.BelongedFaction != null)) { this.BelongedFaction.Architectures.Remove(this); this.BelongedFaction.RemoveArchitectureKnownData(this); if (!base.Scenario.IsPlayer(this.BelongedFaction)) { this.ClearRouteways(); } else { foreach (Routeway routeway in this.Routeways) { this.BelongedFaction.RemoveRouteway(routeway); } } foreach (Person person in this.Persons) { this.BelongedFaction.RemovePerson(person); } foreach (Person person in this.MovingPersons) { this.BelongedFaction.RemovePerson(person); } foreach (Captive captive in this.Captives) { this.BelongedFaction.RemoveCaptive(captive); } foreach (Military military in this.Militaries) { this.BelongedFaction.RemoveMilitary(military); } this.BelongedFaction = null; faction.AddArchitecture(this); faction.AddArchitectureKnownData(this); faction.AddArchitecturePersons(this); foreach (Person person in this.MovingPersons) { faction.AddPerson(person); } foreach (Captive captive in this.Captives.GetList()) { if (captive.CaptiveFaction == faction) { captive.CaptivePerson.BelongedCaptive = null; this.RemoveCaptive(captive); captive.CaptiveFaction.RemoveSelfCaptive(captive); base.Scenario.Captives.Remove(captive); } else { faction.AddCaptive(captive); } } this.InformationCoolDown = 0; foreach (Military military in this.Militaries) { faction.AddMilitary(military); } foreach (Routeway routeway in this.Routeways) { faction.AddRouteway(routeway); } faction.FirstSection.AddArchitecture(this); } if (faction != null) { this.jianzhuqizi.qizidezi.Text = faction.ToString().Substring(0, 1); } }