Example #1
0
        /// <summary>
        /// Inventory Blueprint Types
        /// </summary>
        /// <returns><c>Bag</c> of Inventory Blueprint Types</returns>
        internal static Bag<InvBlueprintTypes> BlueprintTypes()
        {
            var list = new IndexedList<InvBlueprintTypes>();

            foreach (var blueprint in Context.invBlueprintTypes)
            {
                var item = new InvBlueprintTypes
                               {
                                   ID = blueprint.blueprintTypeID,
                                   ParentID = blueprint.parentBlueprintTypeID,
                                   ProductTypeID = blueprint.productTypeID.Value,
                                   ProductionTime = blueprint.productionTime.Value,
                                   TechLevel = blueprint.techLevel.Value,
                                   ResearchProductivityTime = blueprint.researchProductivityTime.Value,
                                   ResearchMaterialTime = blueprint.researchMaterialTime.Value,
                                   ResearchCopyTime = blueprint.researchCopyTime.Value,
                                   ResearchTechTime = blueprint.researchTechTime.Value,
                                   ProductivityModifier = blueprint.productivityModifier.Value,
                                   WasteFactor = blueprint.wasteFactor.Value,
                                   MaxProductionLimit = blueprint.maxProductionLimit.Value
                               };

                list.Items.Add(item);
            }

            return new Bag<InvBlueprintTypes>(list);
        }
Example #2
0
        /// <summary>
        /// Inventory Blueprint Types.
        /// </summary>
        /// <returns><c>BagCollection</c> of Inventory Blueprint Types.</returns>
        private static BagCollection<InvBlueprintTypes> BlueprintTypes()
        {
            IndexedCollection<InvBlueprintTypes> collection = new IndexedCollection<InvBlueprintTypes>();

            foreach (invBlueprintTypes blueprint in s_context.invBlueprintTypes)
            {
                InvBlueprintTypes item = new InvBlueprintTypes
                {
                    ID = blueprint.blueprintTypeID,
                    ParentID = blueprint.parentBlueprintTypeID,
                };

                if (blueprint.productTypeID.HasValue)
                    item.ProductTypeID = blueprint.productTypeID.Value;

                if (blueprint.productionTime.HasValue)
                    item.ProductionTime = blueprint.productionTime.Value;

                if (blueprint.techLevel.HasValue)
                    item.TechLevel = blueprint.techLevel.Value;

                if (blueprint.researchProductivityTime.HasValue)
                    item.ResearchProductivityTime = blueprint.researchProductivityTime.Value;

                if (blueprint.researchMaterialTime.HasValue)
                    item.ResearchMaterialTime = blueprint.researchMaterialTime.Value;

                if (blueprint.researchCopyTime.HasValue)
                    item.ResearchCopyTime = blueprint.researchCopyTime.Value;

                if (blueprint.researchTechTime.HasValue)
                    item.ResearchTechTime = blueprint.researchTechTime.Value;

                if (blueprint.duplicatingTime.HasValue)
                    item.DuplicatingTime = blueprint.duplicatingTime.Value;

                if (blueprint.reverseEngineeringTime.HasValue)
                    item.ReverseEngineeringTime = blueprint.reverseEngineeringTime.Value;

                if (blueprint.inventionTime.HasValue)
                    item.InventionTime = blueprint.inventionTime.Value;

                if (blueprint.productivityModifier.HasValue)
                    item.ProductivityModifier = blueprint.productivityModifier.Value;

                if (blueprint.wasteFactor.HasValue)
                    item.WasteFactor = blueprint.wasteFactor.Value;

                if (blueprint.maxProductionLimit.HasValue)
                    item.MaxProductionLimit = blueprint.maxProductionLimit.Value;

                collection.Items.Add(item);
            }

            BlueprintsTotalCount = collection.Items.Count;

            return collection.ToBag();
        }