public static void LoadMissionPool(DatabaseConnection dbConnection, int difficulty) { MissionPool missionPool = new MissionPool(); var database = dbConnection.Database; string query = "SELECT mission_client.DexNum, mission_client.FormNum " + "FROM mission_client " + "WHERE mission_client.Rank = \'" + difficulty + "\' " + "ORDER BY mission_client.ClientIndex"; foreach (DataColumnCollection column in database.RetrieveRowsEnumerable(query)) { MissionClientData data = new MissionClientData(); data.Species = column["DexNum"].ValueString.ToInt(); data.Form = column["FormNum"].ValueString.ToInt(); missionPool.MissionClients.Add(data); } query = "SELECT mission_enemy.NpcNum " + "FROM mission_enemy " + "WHERE mission_enemy.Rank = \'" + difficulty + "\' " + "ORDER BY mission_enemy.EnemyIndex"; foreach (DataColumnCollection column in database.RetrieveRowsEnumerable(query)) { MissionEnemyData data = new MissionEnemyData(); data.NpcNum = column["NpcNum"].ValueString.ToInt(); missionPool.Enemies.Add(data); } 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.Amount = column["ItemAmount"].ValueString.ToInt(); data.Tag = column["ItemTag"].ValueString; missionPool.Rewards.Add(data); } missionPools.MissionPools.Add(missionPool); }
public static void LoadMissionPool(DatabaseConnection dbConnection, int difficulty) { MissionPool missionPool = new MissionPool(); MySql database = dbConnection.Database; string query = "SELECT mission_client.DexNum, mission_client.FormNum " + "FROM mission_client " + "WHERE mission_client.Rank = \'" + difficulty + "\' " + "ORDER BY mission_client.ClientIndex"; foreach (DataColumnCollection column in database.RetrieveRowsEnumerable(query)) { MissionClientData data = new MissionClientData(); data.Species = column["DexNum"].ValueString.ToInt(); data.Form = column["FormNum"].ValueString.ToInt(); missionPool.MissionClients.Add(data); } query = "SELECT mission_enemy.NpcNum " + "FROM mission_enemy " + "WHERE mission_enemy.Rank = \'" + difficulty + "\' " + "ORDER BY mission_enemy.EnemyIndex"; foreach (DataColumnCollection column in database.RetrieveRowsEnumerable(query)) { MissionEnemyData data = new MissionEnemyData(); data.NpcNum = column["NpcNum"].ValueString.ToInt(); missionPool.Enemies.Add(data); } 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.Amount = column["ItemAmount"].ValueString.ToInt(); data.Tag = column["ItemTag"].ValueString; missionPool.Rewards.Add(data); } missionPools.MissionPools.Add(missionPool); }