public static Dictionary <int, LandingBonusRare> ReadBonusRares() { Dictionary <int, LandingBonusRare> bonusRares = new Dictionary <int, LandingBonusRare>(); using (DatabaseConnection dbClient = Alias.Server.DatabaseManager.GetConnection()) { using (MySqlDataReader Reader = dbClient.DataReader("SELECT * FROM `landing_bonus_rares`")) { while (Reader.Read()) { ItemData prize = Alias.Server.ItemManager.GetItemData(Reader.GetInt32("item_id")); if (prize == null) { continue; } LandingBonusRare bonusRare = new LandingBonusRare() { Name = Reader.GetString("name"), Prize = prize, Goal = Reader.GetInt32("goal") }; if (!bonusRares.ContainsKey(Reader.GetInt32("id"))) { bonusRares.Add(Reader.GetInt32("id"), bonusRare); } } } } return(bonusRares); }
public bool TryGetBonusRare(int id, out LandingBonusRare data) { return(this.BonusRares.TryGetValue(id, out data)); }