예제 #1
0
        private IkadnBaseObject saveConstruction(ObjectIndexer indexer)
        {
            var queue = new IkonArray();

            foreach (var plan in this.ConstructionPlans)
            {
                IkonComposite planData;

                if (plan.Key.Location.Planet == null)
                {
                    planData = new IkonComposite(StellarisConstructionTag);
                    planData.Add(LocationKey, new IkonInteger(indexer.IndexOf((StellarisAdmin)plan.Key)));
                }
                else
                {
                    planData = new IkonComposite(ColonyConstructionTag);
                    planData.Add(LocationKey, new IkonInteger(indexer.IndexOf((Colony)plan.Key)));
                }

                planData.Add(OrdersKey, plan.Value.Save(indexer));
                queue.Add(planData);
            }

            return(queue);
        }
        public IkonComposite Save(ObjectIndexer indexer)
        {
            var data = new IkonComposite(TableTag);

            data.Add(OwnerKey, new IkonInteger(indexer.IndexOf(this.Owner)));

            data.Add(DestinationKey, new IkonInteger(indexer.IndexOf(this.Destination)));
            return(data);
        }
예제 #3
0
        public IkonComposite Save(ObjectIndexer indexer)
        {
            var data = new IkonComposite(TableTag);

            data.Add(FromStarKey, new IkonInteger(indexer.IndexOf(this.FromStar)));

            data.Add(ToStarKey, new IkonInteger(indexer.IndexOf(this.ToStar)));
            return(data);
        }
예제 #4
0
        public IkonComposite Save(ObjectIndexer indexer)
        {
            var data = new IkonComposite(TableTag);

            data.Add(Party1Key, new IkonInteger(indexer.IndexOf(this.Party1)));

            data.Add(Party2Key, new IkonInteger(indexer.IndexOf(this.Party2)));
            return(data);
        }
예제 #5
0
		public IkonComposite Save(ObjectIndexer indexer) 
		{
			var data = new IkonComposite(TableTag);
			data.Add(DestinationKey, new IkonInteger(indexer.IndexOf(this.Destination)));

			var sourcesData = new IkonArray();
			foreach(var item in this.Sources)
				sourcesData.Add(new IkonInteger(indexer.IndexOf(item)));
			data.Add(SourcesKey, sourcesData);
			return data;
 
		}
예제 #6
0
        public override Ikadn.IkadnBaseObject Save(ObjectIndexer indexer)
        {
            var saveData = new IkonComposite(MissionTag);

            saveData.Add(DestinationKey, new IkonInteger(indexer.IndexOf(this.Destination)));

            if (this.UsedWormhole != null)
            {
                saveData.Add(WormholeKey, new IkonInteger(indexer.IndexOf(this.UsedWormhole)));
            }

            return(saveData);
        }
예제 #7
0
        public IkonComposite Save(ObjectIndexer indexer)
        {
            var data = new IkonComposite(TableTag);

            data.Add(NameKey, new IkonText(this.Name));

            var colorData = new IkonArray();

            colorData.Add(new IkonInteger(this.Color.R));
            colorData.Add(new IkonInteger(this.Color.G));
            colorData.Add(new IkonInteger(this.Color.B));
            data.Add(ColorKey, colorData);

            data.Add(ControlTypeKey, new IkonComposite(this.ControlType.ToString()));

            data.Add(OffscreenControlKey, this.OffscreenControl != null ? this.OffscreenControl.Save() : new IkonComposite("None"));

            var unlockedDesignsData = new IkonArray();

            foreach (var item in this.UnlockedDesigns)
            {
                unlockedDesignsData.Add(new IkonInteger(indexer.IndexOf(item)));
            }
            data.Add(UnlockedDesignsKey, unlockedDesignsData);

            data.Add(IntelligenceKey, this.Intelligence.Save(indexer));
            return(data);
        }
예제 #8
0
        public virtual IkonComposite Save(ObjectIndexer indexer)
        {
            var data = new IkonComposite(TableTag);

            data.Add(LocationKey, this.Location.Save(indexer));

            data.Add(OwnerKey, new IkonInteger(indexer.IndexOf(this.Owner)));

            var buildingsData = new IkonArray();

            foreach (var item in this.Buildings)
            {
                var itemData = new IkonComposite(BuildingsTag);
                itemData.Add(BuildingTypeKey, new IkonText(item.Key));
                itemData.Add(BuildingAmountKey, new IkonFloat(item.Value));
                buildingsData.Add(itemData);
            }
            data.Add(BuildingsKey, buildingsData);

            var stockpileData = new IkonArray();

            foreach (var item in this.Stockpile)
            {
                var itemData = new IkonComposite(StockpileTag);
                itemData.Add(StockpileGroupKey, new IkonText(item.Key));
                itemData.Add(StockpileAmountKey, new IkonFloat(item.Value));
                stockpileData.Add(itemData);
            }
            data.Add(StockpileKey, stockpileData);
            return(data);
        }
예제 #9
0
        public IkonComposite Save(ObjectIndexer indexer)
        {
            var data = new IkonComposite(TableTag);

            data.Add(OwnerKey, new IkonInteger(indexer.IndexOf(this.Owner)));

            var positionData = new IkonArray();

            positionData.Add(new IkonFloat(this.Position.X));
            positionData.Add(new IkonFloat(this.Position.Y));
            data.Add(PositionKey, positionData);

            var missionsData = new IkonArray();

            foreach (var item in this.Missions)
            {
                missionsData.Add(item.Save(indexer));
            }
            data.Add(MissionsKey, missionsData);

            var shipsData = new IkonArray();

            foreach (var item in this.Ships)
            {
                shipsData.Add(item.Save(indexer));
            }
            data.Add(ShipsKey, shipsData);
            return(data);
        }
예제 #10
0
        public override IkadnBaseObject Save(ObjectIndexer indexer)
        {
            var saveData = new IkonComposite(MissionTag);

            saveData.Add(TargetKey, new IkonInteger(indexer.IndexOf(this.Target)));

            return(saveData);
        }
예제 #11
0
        public IkadnBaseObject Save(ObjectIndexer indexer)
        {
            var data = new IkonComposite(SaveTag);

            data.Add(CountKey, new IkonInteger(this.TechProgress.CompletedCount));
            data.Add(InvestedKey, new IkonFloat(this.TechProgress.InvestedPoints));
            data.Add(LeftoverKey, new IkonFloat(this.TechProgress.LeftoverPoints));
            data.Add(TopicKey, new IkonInteger(indexer.IndexOf(this.TechProgress.Item)));

            return(data);
        }
예제 #12
0
        public IkonComposite Save(ObjectIndexer indexer)
        {
            var data = new IkonComposite(TableTag);

            data.Add(IdCodeKey, new IkonText(this.IdCode));

            data.Add(OwnerKey, new IkonInteger(indexer.IndexOf(this.Owner)));

            data.Add(IsObsoleteKey, new IkonInteger(this.IsObsolete ? 1 : -1));

            data.Add(IsVirtualKey, new IkonInteger(this.IsVirtual ? 1 : -1));

            data.Add(NameKey, new IkonText(this.Name));

            data.Add(ImageIndexKey, new IkonInteger(this.ImageIndex));

            data.Add(ArmorKey, this.Armor.Save());

            data.Add(HullKey, this.Hull.Save());

            if (this.IsDrive != null)
            {
                data.Add(IsDriveKey, this.IsDrive.Save());
            }

            data.Add(ReactorKey, this.Reactor.Save());

            data.Add(SensorsKey, this.Sensors.Save());

            if (this.Shield != null)
            {
                data.Add(ShieldKey, this.Shield.Save());
            }

            var missionEquipmentData = new IkonArray();

            foreach (var item in this.MissionEquipment)
            {
                missionEquipmentData.Add(item.Save());
            }
            data.Add(EquipmentKey, missionEquipmentData);

            var specialEquipmentData = new IkonArray();

            foreach (var item in this.SpecialEquipment)
            {
                specialEquipmentData.Add(item.Save());
            }
            data.Add(SpecialsKey, specialEquipmentData);

            data.Add(ThrustersKey, this.Thrusters.Save());
            return(data);
        }
예제 #13
0
        private IkadnBaseObject saveRefitOrders(ObjectIndexer indexer)
        {
            var list = new IkonArray();

            foreach (var order in this.RefitOrders)
            {
                if (order.Value == null)
                {
                    list.Add(new IkonComposite(DisbandOrderTag));
                }
                else
                {
                    var orderData = new IkonComposite(RefitOrderTag);
                    orderData.Add(FromDesignKey, new IkonInteger(indexer.IndexOf(order.Key)));
                    orderData.Add(ToDesignKey, new IkonInteger(indexer.IndexOf(order.Value)));

                    list.Add(orderData);
                }
            }

            return(list);
        }
예제 #14
0
        public IkonComposite Save(ObjectIndexer indexer)
        {
            var data = new IkonComposite(TableTag);

            data.Add(DesignKey, new IkonInteger(indexer.IndexOf(this.Design)));

            data.Add(QuantityKey, new IkonInteger(this.Quantity));

            data.Add(DamageKey, new IkonFloat(this.Damage));

            data.Add(UpgradePointsKey, new IkonFloat(this.UpgradePoints));
            return(data);
        }
예제 #15
0
        public IkonComposite Save(ObjectIndexer indexer)
        {
            var data = new IkonComposite(TableTag);

            data.Add(OwnerKey, new IkonInteger(indexer.IndexOf(this.Owner)));

            data.Add(TopicKey, new IkonText(this.Topic.IdCode));

            data.Add(LevelKey, new IkonInteger(this.Level));

            data.Add(InvestedKey, new IkonFloat(this.InvestedPoints));
            return(data);
        }
예제 #16
0
        public IkonComposite Save(ObjectIndexer indexer)
        {
            var data = new IkonComposite(TableTag);
            var starKnowledgeData = new IkonArray();

            foreach (var item in this.starKnowledge)
            {
                var itemData = new IkonComposite(StarIntellTag);
                itemData.Add(StarDataKey, new IkonInteger(indexer.IndexOf(item.Key)));
                itemData.Add(StarIntelligenceKey, item.Value.Save(indexer));
                starKnowledgeData.Add(itemData);
            }
            data.Add(StarKnowledgeKey, starKnowledgeData);
            return(data);
        }
예제 #17
0
        private IkadnBaseObject saveColonizationOrders(ObjectIndexer indexer)
        {
            var queue = new IkonArray();

            foreach (var order in this.ColonizationOrders)
            {
                IkonComposite orderData;

                orderData = new IkonComposite(ColonizationOrdersTag);
                orderData.Add(ColonizationDestinationTag, new IkonInteger(indexer.IndexOf(order.Value.Destination)));
                orderData.Add(ColonizationSourcesTag, new IkonArray(order.Value.Sources.Select(x => new IkonInteger(indexer.IndexOf(x)))));
                queue.Add(orderData);
            }

            return(queue);
        }
예제 #18
0
        public IkonComposite Save(ObjectIndexer indexer)
        {
            var data = new IkonComposite(TableTag);

            data.Add(LastVisitedKey, new IkonInteger(this.LastVisited));

            var planetsData = new IkonArray();

            foreach (var item in this.Planets)
            {
                var itemData = new IkonComposite(PlanetIntellTag);
                itemData.Add(PlanetKey, new IkonInteger(indexer.IndexOf(item.Key)));
                itemData.Add(PlanetIntelligenceKey, item.Value.Save());
                planetsData.Add(itemData);
            }
            data.Add(PlanetsKey, planetsData);
            return(data);
        }
예제 #19
0
        public IkonComposite Save(ObjectIndexer indexer)
        {
            var data = new IkonComposite(TableTag);

            data.Add(StarKey, new IkonInteger(indexer.IndexOf(this.Star)));

            data.Add(PositionKey, new IkonInteger(this.Position));

            data.Add(TypeKey, new IkonComposite(this.Type.ToString()));

            data.Add(SizeKey, new IkonFloat(this.Size));

            var traitsData = new IkonArray();

            foreach (var item in this.Traits)
            {
                traitsData.Add(item.Save());
            }
            data.Add(TraitsKey, traitsData);
            return(data);
        }
예제 #20
0
 public IkadnBaseObject Save(ObjectIndexer indexer)
 {
     return(this.Planet == null ?
            new IkonComposite(StarTag).Add(IdKey, new IkonInteger(indexer.IndexOf(this.Star))) :
            new IkonComposite(PlanetTag).Add(IdKey, new IkonInteger(indexer.IndexOf(this.Planet))));
 }