protected AConstructionSite(LocationBody location, Player owner) { this.Location = location; this.Owner = owner; this.Buildings = new Dictionary <string, double>(); this.Stockpile = new Dictionary <string, double>(); #if DEBUG this.id = nextId(); #endif }
protected AConstructionSite(AConstructionSite original, LocationBody location, Player owner) : this(location, owner) { this.Buildings = new Dictionary <string, double>(); foreach (var item in original.Buildings) { this.Buildings.Add(item.Key, item.Value); } this.Stockpile = new Dictionary <string, double>(); foreach (var item in original.Stockpile) { this.Stockpile.Add(item.Key, item.Value); } #if DEBUG this.id = NextId(); #endif }
protected AConstructionSite(IkonComposite rawData, ObjectDeindexer deindexer) { var locationSave = rawData[LocationKey]; this.Location = LocationBody.Load(locationSave.To <IkonComposite>(), deindexer); var ownerSave = rawData[OwnerKey]; this.Owner = deindexer.Get <Player>(ownerSave.To <int>()); var buildingsSave = rawData[BuildingsKey]; this.Buildings = new Dictionary <string, double>(); foreach (var item in buildingsSave.To <IEnumerable <IkonComposite> >()) { var itemKey = item[BuildingTypeKey]; var itemValue = item[BuildingAmountKey]; this.Buildings.Add( itemKey.To <string>(), itemValue.To <double>() ); } var stockpileSave = rawData[StockpileKey]; this.Stockpile = new Dictionary <string, double>(); foreach (var item in stockpileSave.To <IEnumerable <IkonComposite> >()) { var itemKey = item[StockpileGroupKey]; var itemValue = item[StockpileAmountKey]; this.Stockpile.Add( itemKey.To <string>(), itemValue.To <double>() ); } #if DEBUG this.id = NextId(); #endif }
public ITraitEffect Load(LocationBody location, BodyTrait parentTrait, IkonComposite loadData) { return(new TraitEffectAfflictPlanets(this, parentTrait, location.Star, loadData[StaticsDB.DurationTraitId].To <int>())); }
public ITraitEffect Instantiate(LocationBody location, BodyTrait parentTrait) { return(new TraitEffectAfflictPlanets(this, parentTrait, location.Star, (int)this.initialDuration)); }
public bool Equals(LocationBody other) { return(object.Equals(this.Star, other.Star) && object.Equals(this.Planet, other.Planet)); }
private BodyTrait(BodyTraitType type, LocationBody location, IkonComposite loadData) { this.Type = type; this.Effect = type.Effect.Load(location, this, loadData); }
private BodyTrait(BodyTraitType type, LocationBody location) { this.Type = type; this.Effect = type.Effect.Instantiate(location, this); }
public ITraitEffect Instantiate(LocationBody location, BodyTrait parentTrait) { return(new TraitEffectPassive()); }
public ITraitEffect Load(LocationBody location, BodyTrait bodyTrait, IkonComposite loadData) { return(new TraitEffectPassive()); }