예제 #1
0
        public static IEnumerable <EVEMaterial> ProductionBaseMaterials(string typeName)
        {
            invType dcType = TypesHelper.GetType(typeName);

            Dictionary <int, EVEMaterial> matInfo = new Dictionary <int, EVEMaterial>();

            foreach (invTypeMaterial m in TypesHelper.GetTypeMaterials(dcType))
            {
                matInfo[m.materialTypeID] = new EVEMaterial(EVECache.GetItem(m.materialTypeID), m.quantity, 1.0, false);
            }

            invBlueprintType bpType = TypesHelper.GetBlueprintType(dcType);

            if (bpType != null)
            {
                foreach (ramTypeRequirement m in TypesHelper.GetRamTypeRequirements(bpType).Where(x => x.activityID == 1))
                {
                    if (m.recycle.Value)
                    {
                        IEnumerable <EVEMaterial> subMats = ProductionBaseMaterials(TypesHelper.GetType(m.requiredTypeID).typeName);
                        foreach (EVEMaterial subMat in subMats)
                        {
                            if (matInfo.ContainsKey(subMat.item.TypeID))
                            {
                                matInfo[subMat.item.TypeID].quantity -= subMat.quantity;
                            }
                        }
                    }
                }
            }

            return(matInfo.Values.Where(x => x.quantity > 0).OrderByDescending(x => x.quantity).ToList());
        }
예제 #2
0
        public static decimal GetProductionTime(string typeName, int PE)
        {
            invBlueprintType blueprint = TypesHelper.GetBlueprintType(TypesHelper.GetType(typeName));

            decimal baseProdTime = (decimal)blueprint.productionTime.Value;
            decimal prodMod      = (decimal)blueprint.productivityModifier.Value;

            if (PE < 0)
            {
                return(baseProdTime * 0.8m * (1 - (prodMod / baseProdTime) * (PE - 1)));
            }
            else
            {
                return(baseProdTime * 0.8m * (1 - (prodMod / baseProdTime) * (PE / (1 + PE))));
            }
        }
예제 #3
0
        public static IEnumerable <EVEMaterial> ProductionExtraMaterials(string typeName)
        {
            invType dcType = TypesHelper.GetType(typeName);

            List <EVEMaterial> matInfo = new List <EVEMaterial>();
            invBlueprintType   bpType  = TypesHelper.GetBlueprintType(dcType);

            if (bpType != null)
            {
                foreach (ramTypeRequirement m in TypesHelper.GetRamTypeRequirements(bpType).Where(x => x.activityID == 1))
                {
                    matInfo.Add(new EVEMaterial(EVECache.GetItem(m.requiredTypeID), m.quantity.Value, m.damagePerJob.Value, true));
                }
            }

            return(matInfo);
        }
예제 #4
0
        public static IEnumerable <EVEMaterial> GetInventionRequirements(string t2ItemName)
        {
            List <EVEMaterial> result = new List <EVEMaterial>();

            invType          t1type = TypesHelper.GetMeta0Type(t2ItemName);
            invBlueprintType bpType = TypesHelper.GetBlueprintType(t1type);
            IEnumerable <ramTypeRequirement> ramReqs = TypesHelper.GetRamTypeRequirements(bpType).Where(x => x.activityID == 8);

            foreach (ramTypeRequirement r in ramReqs)
            {
                invType     reqType = TypesHelper.GetType(r.requiredTypeID);
                EVEMaterial newMat  = new EVEMaterial(EVECache.GetItem(reqType), r.quantity.Value, r.damagePerJob.Value, true);

                if (reqType.groupID == 716)
                {
                    newMat.damage = 0;
                }

                result.Add(newMat);
            }

            return(result);
        }
예제 #5
0
 public static IEnumerable <ramTypeRequirement> GetRamTypeRequirements(invBlueprintType blueprintType)
 {
     return(GetRamTypeRequirements(blueprintType.blueprintTypeID));
 }