Пример #1
0
        public static BPDetails GetBlueprintDetails(BlueprintID bpID)
        {
            var query = @"select * from invBlueprintTypes where blueprintTypeID = " + bpID + ";";

            using (var cnn = new SQLiteConnection(DefaultDatabase.dbConnection))
            {
                cnn.Open();
                var reader = DefaultDatabase.RunSQLTableQuery(query, cnn);
                var results = new List<BPMaterial>();
                reader.Read();
                return new BPDetails(
                    reader["productionTime"].ToInt(),
                    reader["researchProductivityTime"].ToInt(),
                    reader["researchMaterialTime"].ToInt(),
                    reader["researchCopyTime"].ToInt(),
                    reader["researchTechTime"].ToInt(),
                    reader["productivityModifier"].ToInt(),
                    reader["materialModifier"].ToInt(),
                    reader["wasteFactor"].ToInt(),
                    reader["maxProductionLimit"].ToInt());
            }
        }
Пример #2
0
 public void OnBlueprintCollected(BlueprintID id)
 {
     this.hudBlueprint.ShowMessage(id);
 }
Пример #3
0
 public static MaterialID GetProductFromBlueprint(BlueprintID bpID)
 {
     var query = @"select productTypeID from invBlueprintTypes where blueprintTypeID = " + bpID + ";";
     return new MaterialID(DefaultDatabase.RunSQLStringQuery(query).ToInt());
 }
Пример #4
0
 public static IEnumerable<BPMaterial> GetMaterialsExtra(BlueprintID bpID, ActivityIDs activity = ActivityIDs.Manufacturing)
 {
     using (var cnn = new SQLiteConnection(DefaultDatabase.dbConnection))
     {
         cnn.Open();
         var query = string.Format(@"
     SELECT t.typeName, r.requiredTypeID, r.quantity, r.damagePerJob
     FROM ramTypeRequirements AS r
     INNER JOIN invTypes AS t ON r.requiredTypeID = t.typeID
     INNER JOIN invGroups AS g ON t.groupID = g.groupID
     WHERE r.typeID = {0}
      AND r.activityID = {1}
      AND g.categoryID != {2};", bpID, (int)activity, CategoryID.Skill);
         var reader = DefaultDatabase.RunSQLTableQuery(query, cnn);
         var results = new List<BPMaterial>();
         while (reader.Read())
         {
             results.Add(new BPMaterial(new MaterialID(reader["requiredTypeID"].ToInt()), reader["quantity"].ToLong(), reader["damagePerJob"].ToDecimal()));
         }
         return results;
     }
 }