Exemplo n.º 1
0
        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
        }
Exemplo n.º 2
0
        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
        }
Exemplo n.º 3
0
        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));
 }
Exemplo n.º 6
0
 public bool Equals(LocationBody other)
 {
     return(object.Equals(this.Star, other.Star) && object.Equals(this.Planet, other.Planet));
 }
Exemplo n.º 7
0
 private BodyTrait(BodyTraitType type, LocationBody location, IkonComposite loadData)
 {
     this.Type   = type;
     this.Effect = type.Effect.Load(location, this, loadData);
 }
Exemplo n.º 8
0
 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());
 }