public static ConstructionOrders Load(IkonComposite rawData, ObjectDeindexer deindexer) { var loadedData = new ConstructionOrders(rawData, deindexer); deindexer.Add(loadedData); return(loadedData); }
private ConstructionOrders(ConstructionOrders original) { this.SpendingRatio = original.SpendingRatio; this.Queue = new List <Constructable>(); foreach (var item in original.Queue) { this.Queue.Add(item); } }
//TODO(later) make separate collections for colony and stellaris construction orders private Dictionary <AConstructionSite, ConstructionOrders> loadConstruction(IkadnBaseObject rawData, ObjectDeindexer deindexer) { var queue = new Dictionary <AConstructionSite, ConstructionOrders>(); foreach (var plan in rawData.To <IEnumerable <IkonComposite> >()) { AConstructionSite site = plan.Tag.Equals(StellarisConstructionTag) ? (AConstructionSite)deindexer.Get <StellarisAdmin>(plan[LocationKey].To <int>()) : (AConstructionSite)deindexer.Get <Colony>(plan[LocationKey].To <int>()); queue.Add(site, ConstructionOrders.Load(plan[OrdersKey].To <IkonComposite>(), deindexer)); } return(queue); }