private ColonizationPlan(ColonizationPlan original, GalaxyRemap galaxyRemap, Planet destination) 
		{
			this.Destination = destination;
			this.Sources = new List<StarData>();
			foreach(var item in original.Sources)
				this.Sources.Add(galaxyRemap.Stars[item]);
 
			 
		}
Esempio n. 2
0
        private Dictionary <Planet, ColonizationPlan> loadColonizationOrders(IkadnBaseObject rawData, ObjectDeindexer deindexer)
        {
            var orders = new Dictionary <Planet, ColonizationPlan>();

            foreach (var orderData in rawData.To <IEnumerable <IkonComposite> >())
            {
                var destination = deindexer.Get <Planet>(orderData[ColonizationDestinationTag].To <int>());
                var plan        = new ColonizationPlan(destination);

                foreach (var sourceIndex in orderData[ColonizationSourcesTag].To <IEnumerable <int> >())
                {
                    plan.Sources.Add(deindexer.Get <StarData>(sourceIndex));
                }

                orders.Add(destination, plan);
            }

            return(orders);
        }
		public static ColonizationPlan Load(IkonComposite rawData, ObjectDeindexer deindexer)
		{
			var loadedData = new ColonizationPlan(rawData, deindexer);
			deindexer.Add(loadedData);
			return loadedData;
		}