public ItemList getMats(int amount, double MEMultiplier) { var db = new SDEEntities(); ItemList mats = new ItemList(db.GetMats(this.typeID, 1).ToList()); mats *= amount; mats *= MEMultiplier; return(mats); }
public static void UpdateSkills() { SDEEntities SDE = new SDEEntities(); SQL("TRUNCATE TABLE skills"); foreach (invType type in SDE.invTypes) { if (type.TopmostMarketGroup != null && type.TopmostMarketGroup.marketGroupName == "Skills") { int rank = SDE.GetAttribute(type.typeID, 275).First().IntOrFloatValue; int primaryAttr = SDE.GetAttribute(type.typeID, 180).First().IntOrFloatValue - 164; int secondaryAttr = SDE.GetAttribute(type.typeID, 181).First().IntOrFloatValue - 164; SQL("INSERT INTO [dbo].[skills] ([typeId], [typeName], [rank], [primaryAttr], [secondaryAttr]) VALUES (" + type.typeID + ", \'" + type.typeName + "\', " + rank + ", " + primaryAttr + ", " + secondaryAttr + ")"); } } }
public static void UpdateOres() { SDEEntities SDE = new SDEEntities(); SQL("TRUNCATE TABLE ore"); foreach (invType type in SDE.invTypes) { if (type.invMarketGroup != null && type.invMarketGroup.parent != null && type.invMarketGroup.parent.marketGroupName == "Standard Ores" && type.typeName.StartsWith("Compressed")) { var types = type.invTypeMaterials.Where(x => x.materialType.typeName == "Tritanium"); int Tritanium = types.Count() > 0 ? types.First().quantity.GetValueOrDefault() : 0; types = type.invTypeMaterials.Where(x => x.materialType.typeName == "Pyerite"); int Pyerite = types.Count() > 0 ? types.First().quantity.GetValueOrDefault() : 0; types = type.invTypeMaterials.Where(x => x.materialType.typeName == "Mexallon"); int Mexallon = types.Count() > 0 ? types.First().quantity.GetValueOrDefault() : 0; types = type.invTypeMaterials.Where(x => x.materialType.typeName == "Isogen"); int Isogen = types.Count() > 0 ? types.First().quantity.GetValueOrDefault() : 0; types = type.invTypeMaterials.Where(x => x.materialType.typeName == "Nocxium"); int Nocxium = types.Count() > 0 ? types.First().quantity.GetValueOrDefault() : 0; types = type.invTypeMaterials.Where(x => x.materialType.typeName == "Zydrine"); int Zydrine = types.Count() > 0 ? types.First().quantity.GetValueOrDefault() : 0; types = type.invTypeMaterials.Where(x => x.materialType.typeName == "Megacyte"); int Megacyte = types.Count() > 0 ? types.First().quantity.GetValueOrDefault() : 0; types = type.invTypeMaterials.Where(x => x.materialType.typeName == "Morphite"); int Morphite = types.Count() > 0 ? types.First().quantity.GetValueOrDefault() : 0; SQL(String.Format("INSERT INTO [dbo].[ore] ([typeID], [name], [Tritanium], [Pyerite], [Mexallon], [Isogen], [Nocxium], [Zydrine], [Megacyte], [Morphite]) " + "VALUES (" + type.typeID + ", \'" + type.typeName + "\', " + "{0}, {1}, {2}, {3}, {4}, {5}, {6}, {7})", Tritanium, Pyerite, Mexallon, Isogen, Nocxium, Zydrine, Megacyte, Morphite)); } } }
public bool isBaseMat() { var db = new SDEEntities(); return(db.GetMats(this.typeID, 1).Count() == 0); }