public static void AddMissionRewardData(MySql database, int difficulty, int index, MissionRewardData data)
 {
     database.AddRow("mission_reward", new IDataColumn[] {
         database.CreateColumn(false, "Rank", difficulty.ToString()),
         database.CreateColumn(false, "RewardIndex", index.ToString()),
         database.CreateColumn(false, "ItemNum", data.ItemNum.ToString()),
         database.CreateColumn(false, "ItemAmount", data.ItemAmount.ToString()),
         database.CreateColumn(false, "ItemTag", data.ItemTag)
     });
 }
Пример #2
0
        public static IEnumerable <MissionRewardData> LoadMissionRewardData(PMDCP.DatabaseConnector.MySql.MySql database, int difficulty)
        {
            string query = "SELECT mission_reward.ItemNum, mission_reward.ItemAmount, mission_reward.ItemTag " +
                           "FROM mission_reward " +
                           "WHERE mission_reward.Rank = \'" + difficulty + "\'  " +
                           "ORDER BY mission_reward.RewardIndex";

            foreach (DataColumnCollection column in database.RetrieveRowsEnumerable(query))
            {
                MissionRewardData data = new MissionRewardData();
                data.ItemNum    = column["ItemNum"].ValueString.ToInt();
                data.ItemAmount = column["ItemAmount"].ValueString.ToInt();
                data.ItemTag    = column["ItemTag"].ValueString;
                yield return(data);
            }
        }
        public static IEnumerable<MissionRewardData> LoadMissionRewardData(MySql database, int difficulty)
        {
            string query = "SELECT mission_reward.ItemNum, mission_reward.ItemAmount, mission_reward.ItemTag " +
                "FROM mission_reward " +
                "WHERE mission_reward.Rank = \'" + difficulty + "\'  " +
                "ORDER BY mission_reward.RewardIndex";

            foreach (DataColumnCollection column in database.RetrieveRowsEnumerable(query)) {
                MissionRewardData data = new MissionRewardData();
                data.ItemNum = column["ItemNum"].ValueString.ToInt();
                data.ItemAmount = column["ItemAmount"].ValueString.ToInt();
                data.ItemTag = column["ItemTag"].ValueString;
                yield return data;
            }
        }
Пример #4
0
 public static void AddMissionRewardData(PMDCP.DatabaseConnector.MySql.MySql database, int difficulty, int index, MissionRewardData data)
 {
     database.AddRow("mission_reward", new IDataColumn[] {
         database.CreateColumn(false, "Rank", difficulty.ToString()),
         database.CreateColumn(false, "RewardIndex", index.ToString()),
         database.CreateColumn(false, "ItemNum", data.ItemNum.ToString()),
         database.CreateColumn(false, "ItemAmount", data.ItemAmount.ToString()),
         database.CreateColumn(false, "ItemTag", data.ItemTag)
     });
 }