public void AddFactionReference(App game) { ++this._factionObjectCount; if (this._factionObjectCount != 1) { return; } List <object> objectList = new List <object>(); objectList.Add((object)this.Name); objectList.Add((object)this.StructDecalInfo.Length); foreach (FactionDecalInfo factionDecalInfo in this.StructDecalInfo) { objectList.Add((object)factionDecalInfo.DecalShipClass); objectList.Add((object)factionDecalInfo.DecalStages.Length); foreach (DecalStageInfo decalStage in factionDecalInfo.DecalStages) { objectList.Add((object)decalStage.DecalStage); objectList.Add((object)decalStage.DecalSize); objectList.Add((object)decalStage.DecalMaterial); } } objectList.Add((object)this.ScorchDecalInfo.Length); foreach (FactionDecalInfo factionDecalInfo in this.ScorchDecalInfo) { objectList.Add((object)factionDecalInfo.DecalShipClass); objectList.Add((object)factionDecalInfo.DecalStages.Length); foreach (DecalStageInfo decalStage in factionDecalInfo.DecalStages) { objectList.Add((object)decalStage.DecalStage); objectList.Add((object)decalStage.DecalSize); objectList.Add((object)decalStage.DecalMaterial); } } objectList.Add((object)this.PsionicPowerPerCrew); objectList.Add((object)this.CrewEfficiencyValue); objectList.Add((object)this.BoardingActionMods.FreshAgentStrength); objectList.Add((object)this.BoardingActionMods.TiredAgentStrength); objectList.Add((object)this.BoardingActionMods.ExhaustedAgentStrength); objectList.Add((object)this.BoardingActionMods.LocationStrength.Default); objectList.Add((object)this.BoardingActionMods.LocationStrength.Cruiser); objectList.Add((object)this.BoardingActionMods.LocationStrength.Dreadnought); objectList.Add((object)this.BoardingActionMods.LocationStrength.Leviathan); objectList.Add((object)this.BoardingActionMods.EfficiencyVSBoarding.Default); objectList.Add((object)this.BoardingActionMods.EfficiencyVSBoarding.Cruiser); objectList.Add((object)this.BoardingActionMods.EfficiencyVSBoarding.Dreadnought); objectList.Add((object)this.BoardingActionMods.EfficiencyVSBoarding.Leviathan); this._factionObject = game.AddObject <FactionObject>(objectList.ToArray()); }
public void ReleaseFactionReference(App game) { if (this._factionObject == null) { return; } if (this._factionObjectCount == 0) { throw new InvalidOperationException("Weapon reference count already 0."); } --this._factionObjectCount; if (this._factionObjectCount != 0) { return; } game.ReleaseObject((IGameObject)this._factionObject); this._factionObject = (FactionObject)null; }
public void SetFaction(Faction value) { if (this._faction == value) { return; } if (this._faction != null) { this._faction.ReleaseFactionReference(this.App); } this._faction = value; if (this._faction != null) { this._faction.AddFactionReference(this.App); } FactionObject factionObject = this._faction != null ? this._faction.FactionObj : (FactionObject)null; this.PostSetProp("Faction", factionObject != null ? factionObject.ObjectID : 0); }