diff --git a/NadekoBot/Classes/DBHandler.cs b/NadekoBot/Classes/DBHandler.cs index fd54899f..0c9c2475 100644 --- a/NadekoBot/Classes/DBHandler.cs +++ b/NadekoBot/Classes/DBHandler.cs @@ -1,19 +1,23 @@ -using System.Collections.Generic; -using System.Linq; +using NadekoBot.Classes._DataModels; using SQLite; -using NadekoBot.Classes._DataModels; using System; +using System.Collections.Generic; +using System.Linq; using System.Linq.Expressions; -namespace NadekoBot.Classes { - internal class DbHandler { +namespace NadekoBot.Classes +{ + internal class DbHandler + { public static DbHandler Instance { get; } = new DbHandler(); private string FilePath { get; } = "data/nadekobot.sqlite"; static DbHandler() { } - public DbHandler() { - using (var conn = new SQLiteConnection(FilePath)) { + public DbHandler() + { + using (var conn = new SQLiteConnection(FilePath)) + { conn.CreateTable(); conn.CreateTable(); conn.CreateTable(); @@ -23,44 +27,55 @@ namespace NadekoBot.Classes { conn.CreateTable(); conn.CreateTable(); conn.CreateTable(); - conn.CreateTable(); conn.CreateTable(); conn.Execute(Queries.TransactionTriggerQuery); } } - internal void InsertData(T o) where T : IDataModel { - using (var conn = new SQLiteConnection(FilePath)) { + internal void InsertData(T o) where T : IDataModel + { + using (var conn = new SQLiteConnection(FilePath)) + { conn.Insert(o, typeof(T)); } } - internal void InsertMany(T objects) where T : IEnumerable { - using (var conn = new SQLiteConnection(FilePath)) { + internal void InsertMany(T objects) where T : IEnumerable + { + using (var conn = new SQLiteConnection(FilePath)) + { conn.InsertAll(objects); } } - internal void UpdateData(T o) where T : IDataModel { - using (var conn = new SQLiteConnection(FilePath)) { + internal void UpdateData(T o) where T : IDataModel + { + using (var conn = new SQLiteConnection(FilePath)) + { conn.Update(o, typeof(T)); } } - internal HashSet GetAllRows() where T : IDataModel, new() { - using (var conn = new SQLiteConnection(FilePath)) { + internal HashSet GetAllRows() where T : IDataModel, new() + { + using (var conn = new SQLiteConnection(FilePath)) + { return new HashSet(conn.Table()); } } - internal CurrencyState GetStateByUserId(long id) { - using (var conn = new SQLiteConnection(FilePath)) { + internal CurrencyState GetStateByUserId(long id) + { + using (var conn = new SQLiteConnection(FilePath)) + { return conn.Table().Where(x => x.UserId == id).FirstOrDefault(); } } - internal T Delete(int id) where T : IDataModel, new() { - using (var conn = new SQLiteConnection(FilePath)) { + internal T Delete(int id) where T : IDataModel, new() + { + using (var conn = new SQLiteConnection(FilePath)) + { var found = conn.Find(id); if (found != null) conn.Delete(found.Id); @@ -71,8 +86,10 @@ namespace NadekoBot.Classes { /// /// Updates an existing object or creates a new one /// - internal void Save(T o) where T : IDataModel, new() { - using (var conn = new SQLiteConnection(FilePath)) { + internal void Save(T o) where T : IDataModel, new() + { + using (var conn = new SQLiteConnection(FilePath)) + { var found = conn.Find(o.Id); if (found == null) conn.Insert(o, typeof(T)); @@ -81,8 +98,10 @@ namespace NadekoBot.Classes { } } - internal T GetRandom(Expression> p) where T : IDataModel, new() { - using (var conn = new SQLiteConnection(FilePath)) { + internal T GetRandom(Expression> p) where T : IDataModel, new() + { + using (var conn = new SQLiteConnection(FilePath)) + { var r = new Random(); return conn.Table().Where(p).ToList().OrderBy(x => r.Next()).FirstOrDefault(); } @@ -90,13 +109,14 @@ namespace NadekoBot.Classes { } } -public static class Queries { +public static class Queries +{ public static string TransactionTriggerQuery = @" CREATE TRIGGER IF NOT EXISTS OnTransactionAdded AFTER INSERT ON CurrencyTransaction BEGIN INSERT OR REPLACE INTO CurrencyState (Id, UserId, Value, DateAdded) - VALUES (COALESCE((SELECT Id from CurrencyState where UserId = NEW.UserId),(SELECT COALESCE(MAX(Id),0)+1 from CurrencyState)), + VALUES (COALESCE((SELECT Id from CurrencyState where UserId = NEW.UserId),(SELECT COALESCE(MAX(Id),0)+1 from CurrencyState)), NEW.UserId, COALESCE((SELECT Value+New.Value FROM CurrencyState Where UserId = NEW.UserId),NEW.Value), NEW.DateAdded); diff --git a/NadekoBot/Classes/JSONModels/Configuration.cs b/NadekoBot/Classes/JSONModels/Configuration.cs index a528cc37..1bfcd92d 100644 --- a/NadekoBot/Classes/JSONModels/Configuration.cs +++ b/NadekoBot/Classes/JSONModels/Configuration.cs @@ -94,7 +94,7 @@ namespace NadekoBot.Classes.JSONModels public string Gambling { get; set; } = "$"; public string Permissions { get; set; } = ";"; public string Programming { get; set; } = "%"; - public string Pokemon { get; set; } = "poke"; + public string Pokemon { get; set; } = ">"; } public static class ConfigHandler diff --git a/NadekoBot/Classes/ServerSpecificConfig.cs b/NadekoBot/Classes/ServerSpecificConfig.cs index 01a0deb3..a7615b56 100644 --- a/NadekoBot/Classes/ServerSpecificConfig.cs +++ b/NadekoBot/Classes/ServerSpecificConfig.cs @@ -1,15 +1,16 @@ -using System; +using Newtonsoft.Json; +using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; using System.IO; using System.Runtime.CompilerServices; -using NadekoBot.Classes.JSONModels; -using Newtonsoft.Json; -namespace NadekoBot.Classes { - internal class SpecificConfigurations { +namespace NadekoBot.Classes +{ + internal class SpecificConfigurations + { public static SpecificConfigurations Default { get; } = new SpecificConfigurations(); public static bool Instantiated { get; private set; } @@ -17,14 +18,19 @@ namespace NadekoBot.Classes { static SpecificConfigurations() { } - private SpecificConfigurations() { + private SpecificConfigurations() + { - if (File.Exists(filePath)) { - try { + if (File.Exists(filePath)) + { + try + { configs = JsonConvert .DeserializeObject>( File.ReadAllText(filePath)); - } catch (Exception ex) { + } + catch (Exception ex) + { Console.WriteLine($"Deserialization failing: {ex}"); } } @@ -42,14 +48,17 @@ namespace NadekoBot.Classes { private readonly object saveLock = new object(); - public void Save() { - lock (saveLock) { + public void Save() + { + lock (saveLock) + { File.WriteAllText(filePath, JsonConvert.SerializeObject(configs, Formatting.Indented)); } } } - internal class ServerSpecificConfig : INotifyPropertyChanged { + internal class ServerSpecificConfig : INotifyPropertyChanged + { [JsonProperty("VoicePlusTextEnabled")] private bool voicePlusTextEnabled; [JsonIgnore] @@ -78,7 +87,8 @@ namespace NadekoBot.Classes { set { listOfSelfAssignableRoles = value; if (value != null) - listOfSelfAssignableRoles.CollectionChanged += (s, e) => { + listOfSelfAssignableRoles.CollectionChanged += (s, e) => + { if (!SpecificConfigurations.Instantiated) return; OnPropertyChanged(); }; @@ -92,34 +102,39 @@ namespace NadekoBot.Classes { set { observingStreams = value; if (value != null) - observingStreams.CollectionChanged += (s, e) => { + observingStreams.CollectionChanged += (s, e) => + { if (!SpecificConfigurations.Instantiated) return; OnPropertyChanged(); }; } } - public ServerSpecificConfig() { + public ServerSpecificConfig() + { ListOfSelfAssignableRoles = new ObservableCollection(); ObservingStreams = new ObservableCollection(); } public event PropertyChangedEventHandler PropertyChanged = delegate { SpecificConfigurations.Default.Save(); }; - private void OnPropertyChanged([CallerMemberName] string propertyName = null) { + private void OnPropertyChanged([CallerMemberName] string propertyName = null) + { Console.WriteLine("property changed"); PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); } } - public class StreamNotificationConfig : IEquatable { + public class StreamNotificationConfig : IEquatable + { public string Username { get; set; } public StreamType Type { get; set; } public ulong ServerId { get; set; } public ulong ChannelId { get; set; } public bool LastStatus { get; set; } - public enum StreamType { + public enum StreamType + { Twitch, Beam, Hitbox, @@ -131,7 +146,8 @@ namespace NadekoBot.Classes { this.Type == other.Type && this.ServerId == other.ServerId; - public override int GetHashCode() { + public override int GetHashCode() + { return (int)((int)ServerId + Username.Length + (int)Type); } } diff --git a/NadekoBot/Modules/Pokemon/PokeStats.cs b/NadekoBot/Modules/Pokemon/PokeStats.cs index 0d9c9d34..b9795043 100644 --- a/NadekoBot/Modules/Pokemon/PokeStats.cs +++ b/NadekoBot/Modules/Pokemon/PokeStats.cs @@ -1,15 +1,12 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Collections.Generic; namespace NadekoBot.Modules.Pokemon { class PokeStats { //Health left - public int HP { get; set; } = 500; + public int Hp { get; set; } = 500; + public int MaxHp { get; } = 500; //Amount of moves made since last time attacked public int MovesMade { get; set; } = 0; //Last people attacked diff --git a/NadekoBot/Modules/Pokemon/PokemonModule.cs b/NadekoBot/Modules/Pokemon/PokemonModule.cs index ac29c79c..3d90cac4 100644 --- a/NadekoBot/Modules/Pokemon/PokemonModule.cs +++ b/NadekoBot/Modules/Pokemon/PokemonModule.cs @@ -1,40 +1,56 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Discord.Commands; using Discord.Modules; -using Discord.Commands; -using NadekoBot.Commands; using NadekoBot.Classes; -using NadekoBot.Extensions; using NadekoBot.Classes._DataModels; using NadekoBot.Classes.Permissions; -using System.Collections.Concurrent; +using NadekoBot.Extensions; using NadekoBot.Modules.Pokemon.PokeTypes; using NadekoBot.Modules.Pokemon.PokeTypes.Extensions; - +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; namespace NadekoBot.Modules.Pokemon { - - class PokemonGame : DiscordModule + class PokemonModule : DiscordModule { public override string Prefix { get; } = NadekoBot.Config.CommandPrefixes.Pokemon; - public readonly int BaseHealth = 500; - //private Dictionary stats = new Dictionary(); + private ConcurrentDictionary Stats = new ConcurrentDictionary(); + public PokemonModule() { } - public PokemonGame() + private int GetDamage(PokeType usertype, PokeType targetType) { - //Something? + var rng = new Random(); + int damage = rng.Next(40, 60); + var multiplier = usertype.Multiplier(targetType); + damage = (int)(damage * multiplier); + return damage; } + + private PokeType GetPokeType(ulong id) + { + + var db = DbHandler.Instance.GetAllRows(); + Dictionary setTypes = db.ToDictionary(x => x.UserId, y => y.type); + if (setTypes.ContainsKey((long)id)) + { + return PokemonTypesMain.IntToPokeType(setTypes[(long)id]); + } + + int remainder = (int)id % 16; + + return PokemonTypesMain.IntToPokeType(remainder); + } + public override void Install(ModuleManager manager) { manager.CreateCommands("", cgb => { - cgb.AddCheck(Classes.Permissions.PermissionChecker.Instance); + cgb.AddCheck(PermissionChecker.Instance); commands.ForEach(cmd => cmd.Init(cgb)); @@ -54,11 +70,11 @@ namespace NadekoBot.Modules.Pokemon // Checking stats first, then move //Set up the userstats PokeStats userStats; - userStats = Stats.GetOrAdd(e.User.Id, defaultStats()); + userStats = Stats.GetOrAdd(e.User.Id, new PokeStats()); //Check if able to move //User not able if HP < 0, has made more than 4 attacks - if (userStats.HP < 0) + if (userStats.Hp < 0) { await e.Channel.SendMessage($"{e.User.Mention} has fainted and was not able to move!"); return; @@ -75,17 +91,17 @@ namespace NadekoBot.Modules.Pokemon } //get target stats PokeStats targetStats; - targetStats = Stats.GetOrAdd(target.Id, defaultStats()); + targetStats = Stats.GetOrAdd(target.Id, new PokeStats()); //If target's HP is below 0, no use attacking - if (targetStats.HP <= 0) + if (targetStats.Hp <= 0) { await e.Channel.SendMessage($"{target.Mention} has already fainted!"); return; } //Check whether move can be used - IPokeType userType = getPokeType(e.User.Id); + PokeType userType = GetPokeType(e.User.Id); var enabledMoves = userType.GetMoves(); if (!enabledMoves.Contains(move.ToLowerInvariant())) @@ -95,13 +111,13 @@ namespace NadekoBot.Modules.Pokemon } //get target type - IPokeType targetType = getPokeType(target.Id); + PokeType targetType = GetPokeType(target.Id); //generate damage - int damage = getDamage(userType, targetType); + int damage = GetDamage(userType, targetType); //apply damage to target - targetStats.HP -= damage; + targetStats.Hp -= damage; - var response = $"{e.User.Mention} used **{move}**{userType.GetImage()} on {target.Mention}{targetType.GetImage()} for **{damage}** damage"; + var response = $"{e.User.Mention} used **{move}**{userType.Image} on {target.Mention}{targetType.Image} for **{damage}** damage"; //Damage type if (damage < 40) @@ -119,13 +135,13 @@ namespace NadekoBot.Modules.Pokemon //check fainted - if (targetStats.HP <= 0) + if (targetStats.Hp <= 0) { response += $"\n**{target.Name}** has fainted!"; } else { - response += $"\n**{target.Name}** has {targetStats.HP} HP remaining"; + response += $"\n**{target.Name}** has {targetStats.Hp} HP remaining"; } //update other stats @@ -149,12 +165,12 @@ namespace NadekoBot.Modules.Pokemon .Description("Lists the moves you are able to use") .Do(async e => { - var userType = getPokeType(e.User.Id); + var userType = GetPokeType(e.User.Id); List movesList = userType.GetMoves(); - var str = "**Moves:**"; + var str = $"**Moves for `{userType.Name}` type.**"; foreach (string m in movesList) { - str += $"\n{userType.GetImage()}{m}"; + str += $"\n{userType.Image}{m}"; } await e.Channel.SendMessage(str); }); @@ -168,7 +184,7 @@ namespace NadekoBot.Modules.Pokemon //Implement NadekoFlowers???? string newMove = e.GetArg("movename").ToLowerInvariant(); var newType = PokemonTypesMain.stringToPokeType(e.GetArg("movetype").ToUpperInvariant()); - int typeNum = newType.GetNum(); + int typeNum = newType.Num; var db = DbHandler.Instance.GetAllRows().Select(x => x.move); if (db.Contains(newMove)) { @@ -183,7 +199,7 @@ namespace NadekoBot.Modules.Pokemon type = typeNum }); }); - await e.Channel.SendMessage($"Added {newType.GetImage()}{newMove}"); + await e.Channel.SendMessage($"Added {newType.Image}{newMove}"); }); cgb.CreateCommand(Prefix + "heal") @@ -201,8 +217,8 @@ namespace NadekoBot.Modules.Pokemon { var targetStats = Stats[usr.Id]; - int HP = targetStats.HP; - if (targetStats.HP == BaseHealth) + int HP = targetStats.Hp; + if (targetStats.Hp == targetStats.MaxHp) { await e.Channel.SendMessage($"{usr.Name} already has full HP!"); return; @@ -215,18 +231,18 @@ namespace NadekoBot.Modules.Pokemon await e.Channel.SendMessage($"{e.User.Mention} you don't have enough NadekoFlowers! \nYou still need {amount - pts} to be able to do this!"); return; } - var up = (usr.Id == e.User.Id) ? "yourself" : usr.Name; - await FlowersHandler.RemoveFlowersAsync(e.User, $"heal {up}", amount); + var target = (usr.Id == e.User.Id) ? "yourself" : usr.Name; + await FlowersHandler.RemoveFlowersAsync(e.User, $"Poke-Heal {target}", amount); //healing - targetStats.HP = BaseHealth; + targetStats.Hp = targetStats.MaxHp; if (HP < 0) { //Could heal only for half HP? - Stats[usr.Id].HP = (BaseHealth / 2); - await e.Channel.SendMessage($"{e.User.Name} revived {usr.Name} for 🌸"); + Stats[usr.Id].Hp = (targetStats.MaxHp / 2); + await e.Channel.SendMessage($"{e.User.Name} revived {usr.Name} with one {NadekoBot.Config.CurrencySign}"); return; } - await e.Channel.SendMessage($"{e.User.Name} healed {usr.Name} for {BaseHealth - HP} HP with a 🌸"); + await e.Channel.SendMessage($"{e.User.Name} healed {usr.Name} for {targetStats.MaxHp - HP} HP with a 🌸"); return; } else @@ -246,8 +262,8 @@ namespace NadekoBot.Modules.Pokemon await e.Channel.SendMessage("No such person."); return; } - var pType = getPokeType(usr.Id); - await e.Channel.SendMessage($"Type of {usr.Name} is **{pType.GetName().ToLowerInvariant()}**{pType.GetImage()}"); + var pType = GetPokeType(usr.Id); + await e.Channel.SendMessage($"Type of {usr.Name} is **{pType.Name.ToLowerInvariant()}**{pType.Image}"); }); @@ -262,7 +278,7 @@ namespace NadekoBot.Modules.Pokemon { DbHandler.Instance.Delete(p.Id); } - + foreach (var entry in DefaultMoves.DefaultMovesList) { DbHandler.Instance.InsertData(new Classes._DataModels.PokeMoves @@ -279,7 +295,7 @@ namespace NadekoBot.Modules.Pokemon { var t = PokemonTypesMain.IntToPokeType(m.type); - str += $"\n{t.GetImage()}{m.move}"; + str += $"\n{t.Image}{m.move}"; } await e.Channel.SendMessage(str); @@ -298,9 +314,9 @@ namespace NadekoBot.Modules.Pokemon await e.Channel.SendMessage("Invalid type specified. Type must be one of:\nNORMAL, FIRE, WATER, ELECTRIC, GRASS, ICE, FIGHTING, POISON, GROUND, FLYING, PSYCHIC, BUG, ROCK, GHOST, DRAGON, DARK, STEEL"); return; } - if (targetType == getPokeType(e.User.Id)) + if (targetType == GetPokeType(e.User.Id)) { - await e.Channel.SendMessage($"Your type is already {targetType.GetName().ToLowerInvariant()}{targetType.GetImage()}"); + await e.Channel.SendMessage($"Your type is already {targetType.Name.ToLowerInvariant()}{targetType.Image}"); return; } @@ -325,54 +341,15 @@ namespace NadekoBot.Modules.Pokemon DbHandler.Instance.InsertData(new Classes._DataModels.userPokeTypes { UserId = (long)e.User.Id, - type = targetType.GetNum() + type = targetType.Num }); //Now for the response - await e.Channel.SendMessage($"Set type of {e.User.Mention} to {targetTypeString}{targetType.GetImage()} for a 🌸"); + await e.Channel.SendMessage($"Set type of {e.User.Mention} to {targetTypeString}{targetType.Image} for a 🌸"); }); }); } - - - - - private int getDamage(IPokeType usertype, IPokeType targetType) - { - Random rng = new Random(); - int damage = rng.Next(40, 60); - double multiplier = 1; - multiplier = usertype.GetMagnifier(targetType); - damage = (int)(damage * multiplier); - return damage; - } - - private IPokeType getPokeType(ulong id) - { - - var db = DbHandler.Instance.GetAllRows(); - Dictionary setTypes = db.ToDictionary(x => x.UserId, y => y.type); - if (setTypes.ContainsKey((long)id)) - { - return PokemonTypesMain.IntToPokeType(setTypes[(long)id]); - } - - int remainder = (int)id % 16; - - return PokemonTypesMain.IntToPokeType(remainder); - - - } - - private PokeStats defaultStats() - { - PokeStats s = new PokeStats(); - s.HP = BaseHealth; - return s; - } - - } } diff --git a/NadekoBot/Modules/Pokemon/PokemonTypes/BugType.cs b/NadekoBot/Modules/Pokemon/PokemonTypes/BugType.cs index 2df84631..64145fe0 100644 --- a/NadekoBot/Modules/Pokemon/PokemonTypes/BugType.cs +++ b/NadekoBot/Modules/Pokemon/PokemonTypes/BugType.cs @@ -1,22 +1,16 @@ -using System; +using NadekoBot.Modules.Pokemon.PokeTypes; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using NadekoBot.Modules.Pokemon; -using NadekoBot.Classes; -using NadekoBot.Classes._DataModels; using NadekoBot.Modules.Pokemon.PokeTypes; namespace NadekoBot.Modules.Pokemon.PokemonTypes { - class BugType : IPokeType + class BugType : PokeType { static readonly string name = "BUG"; public static int numType = 11; - public double GetMagnifier(IPokeType target) + public double Multiplier(PokeType target) { - switch (target.GetName()) + switch (target.Name) { case "FIRE": return 0.5; @@ -33,24 +27,10 @@ namespace NadekoBot.Modules.Pokemon.PokemonTypes } List moves = new List(); - + public string Name => name; + public string Image => "🐛"; - public string GetName() - { - return name; - } - - - - public string GetImage() - { - return "🐛"; - } - - public int GetNum() - { - return numType; - } + public int Num => numType; } } diff --git a/NadekoBot/Modules/Pokemon/PokemonTypes/DarkType.cs b/NadekoBot/Modules/Pokemon/PokemonTypes/DarkType.cs index 54f69e2d..2e29eb2e 100644 --- a/NadekoBot/Modules/Pokemon/PokemonTypes/DarkType.cs +++ b/NadekoBot/Modules/Pokemon/PokemonTypes/DarkType.cs @@ -1,22 +1,16 @@ -using System; +using NadekoBot.Modules.Pokemon.PokeTypes; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using NadekoBot.Modules.Pokemon; -using NadekoBot.Classes; -using NadekoBot.Classes._DataModels; using NadekoBot.Modules.Pokemon.PokeTypes; namespace NadekoBot.Modules.Pokemon.PokemonTypes { - class DarkType : IPokeType + class DarkType : PokeType { static readonly string name = "DARK"; public static int numType = 15; - public double GetMagnifier(IPokeType target) + public double Multiplier(PokeType target) { - switch (target.GetName()) + switch (target.Name) { case "FIGHTING": return 0.5; @@ -29,24 +23,10 @@ namespace NadekoBot.Modules.Pokemon.PokemonTypes } List moves = new List(); - + public string Name => name; + public string Image => "🕶"; - public string GetName() - { - return name; - } - - - - public string GetImage() - { - return "🕶"; - } - - public int GetNum() - { - return numType; - } + public int Num => numType; } } diff --git a/NadekoBot/Modules/Pokemon/PokemonTypes/Dragontype.cs b/NadekoBot/Modules/Pokemon/PokemonTypes/Dragontype.cs index e7168ffc..35ec6332 100644 --- a/NadekoBot/Modules/Pokemon/PokemonTypes/Dragontype.cs +++ b/NadekoBot/Modules/Pokemon/PokemonTypes/Dragontype.cs @@ -1,22 +1,16 @@ -using System; +using NadekoBot.Modules.Pokemon.PokeTypes; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using NadekoBot.Modules.Pokemon; -using NadekoBot.Classes; -using NadekoBot.Classes._DataModels; using NadekoBot.Modules.Pokemon.PokeTypes; namespace NadekoBot.Modules.Pokemon.PokemonTypes { - class DragonType : IPokeType + class DragonType : PokeType { static readonly string name = "DRAGON"; public static int numType = 14; - public double GetMagnifier(IPokeType target) + public double Multiplier(PokeType target) { - switch (target.GetName()) + switch (target.Name) { case "DRAGON": return 2; @@ -26,24 +20,15 @@ namespace NadekoBot.Modules.Pokemon.PokemonTypes } List moves = new List(); - - public string GetName() - { - return name; - } - + public string Name => name; - public string GetImage() - { - return "🐉"; - } - public int GetNum() - { - return numType; - } + + public string Image => "🐉"; + + public int Num => numType; } } diff --git a/NadekoBot/Modules/Pokemon/PokemonTypes/ElectricType.cs b/NadekoBot/Modules/Pokemon/PokemonTypes/ElectricType.cs index 3cb77723..9e44767e 100644 --- a/NadekoBot/Modules/Pokemon/PokemonTypes/ElectricType.cs +++ b/NadekoBot/Modules/Pokemon/PokemonTypes/ElectricType.cs @@ -1,22 +1,16 @@ -using System; +using NadekoBot.Modules.Pokemon.PokeTypes; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using NadekoBot.Modules.Pokemon; -using NadekoBot.Classes; -using NadekoBot.Classes._DataModels; using NadekoBot.Modules.Pokemon.PokeTypes; namespace NadekoBot.Modules.Pokemon.PokemonTypes { - class ElectricType : IPokeType + class ElectricType : PokeType { static readonly string name = "ELECTRIC"; public static int numType = 3; - public double GetMagnifier(IPokeType target) + public double Multiplier(PokeType target) { - switch (target.GetName()) + switch (target.Name) { case "WATER": return 2; @@ -30,23 +24,14 @@ namespace NadekoBot.Modules.Pokemon.PokemonTypes } List moves = new List(); - - public string GetName() - { - return name; - } - - public string GetImage() - { - return "⚡️"; - } + public string Name => name; - public int GetNum() - { - return numType; - } + + public string Image => "⚡️"; + + public int Num => numType; } } diff --git a/NadekoBot/Modules/Pokemon/PokemonTypes/FightingType.cs b/NadekoBot/Modules/Pokemon/PokemonTypes/FightingType.cs index 3d4603ed..6e0e9d09 100644 --- a/NadekoBot/Modules/Pokemon/PokemonTypes/FightingType.cs +++ b/NadekoBot/Modules/Pokemon/PokemonTypes/FightingType.cs @@ -1,22 +1,16 @@ -using System; +using NadekoBot.Modules.Pokemon.PokeTypes; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using NadekoBot.Modules.Pokemon; -using NadekoBot.Classes; -using NadekoBot.Classes._DataModels; using NadekoBot.Modules.Pokemon.PokeTypes; namespace NadekoBot.Modules.Pokemon.PokemonTypes { - class FightingType : IPokeType + class FightingType : PokeType { static readonly string name = "FIGHTING"; public static int numType = 6; - public double GetMagnifier(IPokeType target) + public double Multiplier(PokeType target) { - switch (target.GetName()) + switch (target.Name) { case "NORMAL": return 2; @@ -34,23 +28,14 @@ namespace NadekoBot.Modules.Pokemon.PokemonTypes } List moves = new List(); - - public string GetName() - { - return name; - } - - public string GetImage() - { - return "✊"; - } + public string Name => name; - public int GetNum() - { - return numType; - } + + public string Image => "✊"; + + public int Num => numType; } } diff --git a/NadekoBot/Modules/Pokemon/PokemonTypes/FireType.cs b/NadekoBot/Modules/Pokemon/PokemonTypes/FireType.cs index 6995799a..4504f7c7 100644 --- a/NadekoBot/Modules/Pokemon/PokemonTypes/FireType.cs +++ b/NadekoBot/Modules/Pokemon/PokemonTypes/FireType.cs @@ -1,24 +1,18 @@ -using System; +using NadekoBot.Modules.Pokemon.PokeTypes; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using NadekoBot.Modules.Pokemon; -using NadekoBot.Classes; -using NadekoBot.Classes._DataModels; using NadekoBot.Modules.Pokemon.PokeTypes; namespace NadekoBot.Modules.Pokemon.PokemonTypes { - class FireType : IPokeType + class FireType : PokeType { static readonly string name = "FIRE"; public static int numType = 1; - public double GetMagnifier(IPokeType target) + public double Multiplier(PokeType target) { - switch (target.GetName()) + switch (target.Name) { case "FIRE": return 0.5; @@ -33,25 +27,10 @@ namespace NadekoBot.Modules.Pokemon.PokemonTypes } } List moves = new List(); + public string Name => name; - + public string Image => "🔥"; - - public string GetName() - { - return name; - } - - - - public string GetImage() - { - return "🔥"; - } - - public int GetNum() - { - return numType; - } + public int Num => numType; } } diff --git a/NadekoBot/Modules/Pokemon/PokemonTypes/FlyingType.cs b/NadekoBot/Modules/Pokemon/PokemonTypes/FlyingType.cs index 8f26875b..afd65972 100644 --- a/NadekoBot/Modules/Pokemon/PokemonTypes/FlyingType.cs +++ b/NadekoBot/Modules/Pokemon/PokemonTypes/FlyingType.cs @@ -1,22 +1,16 @@ -using System; +using NadekoBot.Modules.Pokemon.PokeTypes; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using NadekoBot.Modules.Pokemon; -using NadekoBot.Classes; -using NadekoBot.Classes._DataModels; using NadekoBot.Modules.Pokemon.PokeTypes; namespace NadekoBot.Modules.Pokemon.PokemonTypes { - class FlyingType : IPokeType + class FlyingType : PokeType { static readonly string name = "FLYING"; public static int numType = 9; - public double GetMagnifier(IPokeType target) + public double Multiplier(PokeType target) { - switch (target.GetName()) + switch (target.Name) { case "ELECTRIC": return 0.5; @@ -30,24 +24,15 @@ namespace NadekoBot.Modules.Pokemon.PokemonTypes } List moves = new List(); - - public string GetName() - { - return name; - } - + public string Name => name; - public string GetImage() - { - return "☁"; - } - public int GetNum() - { - return numType; - } + + public string Image => "☁"; + + public int Num => numType; } } diff --git a/NadekoBot/Modules/Pokemon/PokemonTypes/GhostType.cs b/NadekoBot/Modules/Pokemon/PokemonTypes/GhostType.cs index 83c35504..f902c403 100644 --- a/NadekoBot/Modules/Pokemon/PokemonTypes/GhostType.cs +++ b/NadekoBot/Modules/Pokemon/PokemonTypes/GhostType.cs @@ -1,22 +1,16 @@ -using System; +using NadekoBot.Modules.Pokemon.PokeTypes; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using NadekoBot.Modules.Pokemon; -using NadekoBot.Classes; -using NadekoBot.Classes._DataModels; using NadekoBot.Modules.Pokemon.PokeTypes; namespace NadekoBot.Modules.Pokemon.PokemonTypes { - class GhostType : IPokeType + class GhostType : PokeType { static readonly string name = "GHOST"; public static int numType = 13; - public double GetMagnifier(IPokeType target) + public double Multiplier(PokeType target) { - switch (target.GetName()) + switch (target.Name) { case "NORMAL": return 0; @@ -29,24 +23,15 @@ namespace NadekoBot.Modules.Pokemon.PokemonTypes } List moves = new List(); - - public string GetName() - { - return name; - } - + public string Name => name; - public string GetImage() - { - return "👻"; - } - public int GetNum() - { - return numType; - } + + public string Image => "👻"; + + public int Num => numType; } } diff --git a/NadekoBot/Modules/Pokemon/PokemonTypes/GrassType.cs b/NadekoBot/Modules/Pokemon/PokemonTypes/GrassType.cs index 1fc34dd6..f861c719 100644 --- a/NadekoBot/Modules/Pokemon/PokemonTypes/GrassType.cs +++ b/NadekoBot/Modules/Pokemon/PokemonTypes/GrassType.cs @@ -1,22 +1,16 @@ -using System; +using NadekoBot.Modules.Pokemon.PokeTypes; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using NadekoBot.Modules.Pokemon; -using NadekoBot.Classes; -using NadekoBot.Classes._DataModels; using NadekoBot.Modules.Pokemon.PokeTypes; namespace NadekoBot.Modules.Pokemon.PokemonTypes { - class GrassType : IPokeType + class GrassType : PokeType { static readonly string name = "GRASS"; public static int numType = 4; - public double GetMagnifier(IPokeType target) + public double Multiplier(PokeType target) { - switch (target.GetName()) + switch (target.Name) { case "FIRE": return 0.5; @@ -32,23 +26,14 @@ namespace NadekoBot.Modules.Pokemon.PokemonTypes } List moves = new List(); - - public string GetName() - { - return name; - } - - public string GetImage() - { - return "🌿"; - } + public string Name => name; - public int GetNum() - { - return numType; - } + + public string Image => "🌿"; + + public int Num => numType; } } diff --git a/NadekoBot/Modules/Pokemon/PokemonTypes/GroundType.cs b/NadekoBot/Modules/Pokemon/PokemonTypes/GroundType.cs index 9795aa77..a09d398c 100644 --- a/NadekoBot/Modules/Pokemon/PokemonTypes/GroundType.cs +++ b/NadekoBot/Modules/Pokemon/PokemonTypes/GroundType.cs @@ -1,22 +1,16 @@ -using System; +using NadekoBot.Modules.Pokemon.PokeTypes; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using NadekoBot.Modules.Pokemon; -using NadekoBot.Classes; -using NadekoBot.Classes._DataModels; using NadekoBot.Modules.Pokemon.PokeTypes; namespace NadekoBot.Modules.Pokemon.PokemonTypes { - class GroundType : IPokeType + class GroundType : PokeType { static readonly string name = "GROUND"; public static int numType = 8; - public double GetMagnifier(IPokeType target) + public double Multiplier(PokeType target) { - switch (target.GetName()) + switch (target.Name) { case "FIRE": return 2; @@ -32,24 +26,10 @@ namespace NadekoBot.Modules.Pokemon.PokemonTypes } List moves = new List(); - + public string Name => name; + public string Image => "🗻"; - public string GetName() - { - return name; - } - - - - public string GetImage() - { - return "🗻"; - } - - public int GetNum() - { - return numType; - } + public int Num => numType; } } diff --git a/NadekoBot/Modules/Pokemon/PokemonTypes/IPokeTypeExtensions.cs b/NadekoBot/Modules/Pokemon/PokemonTypes/IPokeTypeExtensions.cs index 08d354cf..1b81790e 100644 --- a/NadekoBot/Modules/Pokemon/PokemonTypes/IPokeTypeExtensions.cs +++ b/NadekoBot/Modules/Pokemon/PokemonTypes/IPokeTypeExtensions.cs @@ -5,23 +5,23 @@ using System.Collections.Generic; namespace NadekoBot.Modules.Pokemon.PokeTypes.Extensions { public static class IPokeTypeExtensions + { + public static List GetMoves(this PokeType poketype) { - public static List GetMoves(this IPokeType poketype) + var db = DbHandler.Instance.GetAllRows(); + List moves = new List(); + foreach (PokeMoves p in db) { - var db = DbHandler.Instance.GetAllRows(); - List moves = new List(); - foreach (PokeMoves p in db) + if (p.type == poketype.Num) { - if (p.type == poketype.GetNum()) + if (!moves.Contains(p.move)) { - if (!moves.Contains(p.move)) - { - moves.Add(p.move); - } + moves.Add(p.move); } } - return moves; } + return moves; } - } + +} diff --git a/NadekoBot/Modules/Pokemon/PokemonTypes/IceType.cs b/NadekoBot/Modules/Pokemon/PokemonTypes/IceType.cs index 1d1156ad..2afc203d 100644 --- a/NadekoBot/Modules/Pokemon/PokemonTypes/IceType.cs +++ b/NadekoBot/Modules/Pokemon/PokemonTypes/IceType.cs @@ -1,22 +1,16 @@ -using System; +using NadekoBot.Modules.Pokemon.PokeTypes; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using NadekoBot.Modules.Pokemon; -using NadekoBot.Classes; -using NadekoBot.Classes._DataModels; using NadekoBot.Modules.Pokemon.PokeTypes; namespace NadekoBot.Modules.Pokemon.PokemonTypes { - class IceType : IPokeType + class IceType : PokeType { static readonly string name = "ICE"; public static int numType = 5; - public double GetMagnifier(IPokeType target) + public double Multiplier(PokeType target) { - switch (target.GetName()) + switch (target.Name) { case "FIRE": return 0.5; @@ -32,23 +26,10 @@ namespace NadekoBot.Modules.Pokemon.PokemonTypes } List moves = new List(); - + public string Name => name; + public string Image => "❄"; - public string GetName() - { - return name; - } - - - public string GetImage() - { - return "❄"; - } - - public int GetNum() - { - return numType; - } + public int Num => numType; } } diff --git a/NadekoBot/Modules/Pokemon/PokemonTypes/NormalType.cs b/NadekoBot/Modules/Pokemon/PokemonTypes/NormalType.cs index 3052b4e1..1554ddbe 100644 --- a/NadekoBot/Modules/Pokemon/PokemonTypes/NormalType.cs +++ b/NadekoBot/Modules/Pokemon/PokemonTypes/NormalType.cs @@ -1,26 +1,18 @@ -using System; +using NadekoBot.Modules.Pokemon.PokeTypes; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using NadekoBot.Modules.Pokemon; -using NadekoBot.Classes; -using NadekoBot.Classes._DataModels; -using NadekoBot.Modules.Pokemon.PokeTypes; namespace NadekoBot.Modules.Pokemon.PokemonTypes { - class NormalType : IPokeType + class NormalType : PokeType { static readonly string name = "NORMAL"; public static int type_num = 0; - public double GetMagnifier(IPokeType target) + public double Multiplier(PokeType target) { - switch (target.GetName()) + switch (target.Name) { - case "ROCK": return 0.5; case "GHOST": return 0; case "STEEL": return 0.5; @@ -29,24 +21,10 @@ namespace NadekoBot.Modules.Pokemon.PokemonTypes } List moves = new List(); - + public string Name => name; + public string Image => "⭕️"; - public string GetName() - { - return name; - } - - - - public string GetImage() - { - return "⭕️"; - } - - public int GetNum() - { - return type_num; - } + public int Num => type_num; } } diff --git a/NadekoBot/Modules/Pokemon/PokemonTypes/PoisonType.cs b/NadekoBot/Modules/Pokemon/PokemonTypes/PoisonType.cs index 9c30dfae..427508ed 100644 --- a/NadekoBot/Modules/Pokemon/PokemonTypes/PoisonType.cs +++ b/NadekoBot/Modules/Pokemon/PokemonTypes/PoisonType.cs @@ -1,23 +1,16 @@ -using System; +using NadekoBot.Modules.Pokemon.PokeTypes; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using NadekoBot.Modules.Pokemon; -using NadekoBot.Classes; -using NadekoBot.Classes._DataModels; -using NadekoBot.Modules.Pokemon.PokeTypes; namespace NadekoBot.Modules.Pokemon.PokemonTypes { - class PoisonType : IPokeType + class PoisonType : PokeType { static readonly string name = "POISON"; public static int numType = 7; - public double GetMagnifier(IPokeType target) + public double Multiplier(PokeType target) { - switch (target.GetName()) + switch (target.Name) { case "GRASS": return 2; @@ -31,23 +24,10 @@ namespace NadekoBot.Modules.Pokemon.PokemonTypes } List moves = new List(); - + public string Name => name; + public string Image => "☠"; - public string GetName() - { - return name; - } - - - public string GetImage() - { - return "☠"; - } - - public int GetNum() - { - return numType; - } + public int Num => numType; } } diff --git a/NadekoBot/Modules/Pokemon/PokemonTypes/PokeType.cs b/NadekoBot/Modules/Pokemon/PokemonTypes/PokeType.cs index 6c47e466..a7a861ce 100644 --- a/NadekoBot/Modules/Pokemon/PokemonTypes/PokeType.cs +++ b/NadekoBot/Modules/Pokemon/PokemonTypes/PokeType.cs @@ -1,28 +1,24 @@ -using System.Collections.Generic; -using NadekoBot.Classes; -using NadekoBot.Classes._DataModels; -using NadekoBot.Modules.Pokemon.PokemonTypes; +using NadekoBot.Modules.Pokemon.PokemonTypes; +using System.Collections.Generic; namespace NadekoBot.Modules.Pokemon.PokeTypes { - - public interface IPokeType + public interface PokeType { - - string GetImage(); - string GetName(); - int GetNum(); - double GetMagnifier(IPokeType target); + string Image { get; } + string Name { get; } + int Num { get; } + double Multiplier(PokeType target); } public class PokemonTypesMain { - - public static IPokeType stringToPokeType(string newType) + + public static PokeType stringToPokeType(string newType) { - foreach (IPokeType t in TypeList) + foreach (PokeType t in TypeList) { - if (t.GetName() == newType) + if (t.Name == newType) { return t; } @@ -30,26 +26,8 @@ namespace NadekoBot.Modules.Pokemon.PokeTypes return null; } - //public static List getMoves(int numType) - //{ - // var db = DbHandler.Instance.GetAllRows(); - // List moves = new List(); - // foreach (PokeMoves p in db) - // { - // if (p.type == numType) - // { - // if (!moves.Contains(p.move)) - // { - // moves.Add(p.move); - // } - // } - // } - // return moves; - //} - - //These classes can use all methods (except getMoves) - public static List TypeList = new List() + public static List TypeList = new List() { new NormalType(), new FireType(), @@ -70,11 +48,11 @@ namespace NadekoBot.Modules.Pokemon.PokeTypes new SteelType() }; - public static IPokeType IntToPokeType(int id) + public static PokeType IntToPokeType(int id) { - foreach (IPokeType t in TypeList) + foreach (PokeType t in TypeList) { - if (t.GetNum() == id) + if (t.Num == id) { return t; } diff --git a/NadekoBot/Modules/Pokemon/PokemonTypes/PsychicType.cs b/NadekoBot/Modules/Pokemon/PokemonTypes/PsychicType.cs index 1972c197..c386b884 100644 --- a/NadekoBot/Modules/Pokemon/PokemonTypes/PsychicType.cs +++ b/NadekoBot/Modules/Pokemon/PokemonTypes/PsychicType.cs @@ -1,23 +1,16 @@ -using System; +using NadekoBot.Modules.Pokemon.PokeTypes; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using NadekoBot.Modules.Pokemon; -using NadekoBot.Classes; -using NadekoBot.Classes._DataModels; -using NadekoBot.Modules.Pokemon.PokeTypes; namespace NadekoBot.Modules.Pokemon.PokemonTypes { - class PsychicType : IPokeType + class PsychicType : PokeType { static readonly string name = "PSYCHIC"; public static int numType = 10; - public double GetMagnifier(IPokeType target) + public double Multiplier(PokeType target) { - switch (target.GetName()) + switch (target.Name) { case "FIGHTING": return 2; @@ -30,24 +23,13 @@ namespace NadekoBot.Modules.Pokemon.PokemonTypes } List moves = new List(); - - public string GetName() - { - return name; - } - + public string Name => name; - public string GetImage() - { - return "💫"; - } + public string Image => "💫"; - public int GetNum() - { - return numType; - } + public int Num => numType; } } diff --git a/NadekoBot/Modules/Pokemon/PokemonTypes/RockType.cs b/NadekoBot/Modules/Pokemon/PokemonTypes/RockType.cs index 76b7ae44..eafd1803 100644 --- a/NadekoBot/Modules/Pokemon/PokemonTypes/RockType.cs +++ b/NadekoBot/Modules/Pokemon/PokemonTypes/RockType.cs @@ -1,22 +1,16 @@ -using System; +using NadekoBot.Modules.Pokemon.PokeTypes; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using NadekoBot.Modules.Pokemon; -using NadekoBot.Classes; -using NadekoBot.Classes._DataModels; using NadekoBot.Modules.Pokemon.PokeTypes; namespace NadekoBot.Modules.Pokemon.PokemonTypes { - class RockType : IPokeType + class RockType : PokeType { static readonly string name = "ROCK"; public static int numType = 12; - public double GetMagnifier(IPokeType target) + public double Multiplier(PokeType target) { - switch (target.GetName()) + switch (target.Name) { case "FIRE": return 2; @@ -31,24 +25,10 @@ namespace NadekoBot.Modules.Pokemon.PokemonTypes } List moves = new List(); - + public string Name => name; + public string Image => "💎"; - public string GetName() - { - return name; - } - - - - public string GetImage() - { - return "💎"; - } - - public int GetNum() - { - return numType; - } + public int Num => numType; } } diff --git a/NadekoBot/Modules/Pokemon/PokemonTypes/SteelType.cs b/NadekoBot/Modules/Pokemon/PokemonTypes/SteelType.cs index ff8b554b..40dd08c4 100644 --- a/NadekoBot/Modules/Pokemon/PokemonTypes/SteelType.cs +++ b/NadekoBot/Modules/Pokemon/PokemonTypes/SteelType.cs @@ -1,22 +1,16 @@ -using System; +using NadekoBot.Modules.Pokemon.PokeTypes; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using NadekoBot.Modules.Pokemon; -using NadekoBot.Classes; -using NadekoBot.Classes._DataModels; using NadekoBot.Modules.Pokemon.PokeTypes; namespace NadekoBot.Modules.Pokemon.PokemonTypes { - class SteelType : IPokeType + class SteelType : PokeType { static readonly string name = "STEEL"; public static int numType = -1; - public double GetMagnifier(IPokeType target) + public double Multiplier(PokeType target) { - switch (target.GetName()) + switch (target.Name) { case "FIRE": return 0.5; @@ -30,23 +24,10 @@ namespace NadekoBot.Modules.Pokemon.PokemonTypes } List moves = new List(); - + public string Name => name; + public string Image => "🔩"; - public string GetName() - { - return name; - } - - - public string GetImage() - { - return "🔩"; - } - - public int GetNum() - { - return numType; - } + public int Num => numType; } } diff --git a/NadekoBot/Modules/Pokemon/PokemonTypes/WaterType.cs b/NadekoBot/Modules/Pokemon/PokemonTypes/WaterType.cs index e5cfeaaa..2b6c49d8 100644 --- a/NadekoBot/Modules/Pokemon/PokemonTypes/WaterType.cs +++ b/NadekoBot/Modules/Pokemon/PokemonTypes/WaterType.cs @@ -1,22 +1,16 @@ -using System; +using NadekoBot.Modules.Pokemon.PokeTypes; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using NadekoBot.Modules.Pokemon; -using NadekoBot.Classes; -using NadekoBot.Classes._DataModels; using NadekoBot.Modules.Pokemon.PokeTypes; using NadekoBot.Modules.Pokemon.PokeTypes; namespace NadekoBot.Modules.Pokemon.PokemonTypes { - class WaterType : IPokeType + class WaterType : PokeType { static readonly string name = "WATER"; public static int numType = 2; - public double GetMagnifier(IPokeType target) + public double Multiplier(PokeType target) { - switch (target.GetName()) + switch (target.Name) { case "FIRE": return 2; @@ -30,23 +24,10 @@ namespace NadekoBot.Modules.Pokemon.PokemonTypes } List moves = new List(); - + public string Name => name; + public string Image => "💦"; - public string GetName() - { - return name; - } - - - public string GetImage() - { - return "💦"; - } - - public int GetNum() - { - return numType; - } + public int Num => numType; } } diff --git a/NadekoBot/NadekoBot.cs b/NadekoBot/NadekoBot.cs index d4f60c86..986eb15b 100644 --- a/NadekoBot/NadekoBot.cs +++ b/NadekoBot/NadekoBot.cs @@ -7,6 +7,7 @@ using NadekoBot.Commands; using NadekoBot.Modules; using NadekoBot.Modules.Gambling; using NadekoBot.Modules.Pokemon; +using NadekoBot.Modules.Translator; using Newtonsoft.Json; using System; using System.Collections.Generic; @@ -14,7 +15,6 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using NadekoBot.Modules.Translator; namespace NadekoBot { @@ -167,7 +167,7 @@ namespace NadekoBot modules.Add(new Searches(), "Searches", ModuleFilter.None); modules.Add(new NSFW(), "NSFW", ModuleFilter.None); modules.Add(new ClashOfClans(), "ClashOfClans", ModuleFilter.None); - modules.Add(new PokemonGame(), "Pokegame", ModuleFilter.None); + modules.Add(new PokemonModule(), "Pokegame", ModuleFilter.None); modules.Add(new TranslatorModule(), "Translator", ModuleFilter.None); if (!string.IsNullOrWhiteSpace(Creds.TrelloAppKey)) modules.Add(new Trello(), "Trello", ModuleFilter.None);