namespace FiestaBot.Utilities
{
    class SHNSearch
    {
        public static string FindNameByID(FindType Type, ushort ID)
        {
            switch ((byte)Type)
            {
                case 1: return Program.ResSystem.ItemInfo.Find(x => x.ItemID == ID).ItemName;
                case 2: return Program.ResSystem.MobInfo.Find(x => x.MobID == ID).MobName;
                case 3: return Program.ResSystem.MapInfo.Find(x => x.MapID == ID).MapName;
                case 4: return Program.ResSystem.HairInfo.Find(x => x.HairID == ID).HairName;
                case 5: return Program.ResSystem.HairColorInfo.Find(x => x.HairColorID == ID).HairColorName;
                case 6: return Program.ResSystem.FaceInfo.Find(x => x.FaceID == ID).FaceName;
                default: return "Unknown";
            }
        }

        public static string FindNameByInx(FindType Type, string Inx)
        {
            switch ((byte)Type)
            {
                case 1: return Program.ResSystem.ItemInfo.Find(x => x.ItemInx == Inx).ItemName ?? "Unknown";
                case 2: return Program.ResSystem.MobInfo.Find(x => x.MobInx == Inx).MobName ?? "Unknown";
                case 3: return Program.ResSystem.MapInfo.Find(x => x.MapInx == Inx).MapName ?? "Unknown";
                default: return "Unknown";
            }
        }

        public static string FindInxByID(FindType Type, ushort ID)
        {
            switch ((byte)Type)
            {
                case 1: return Program.ResSystem.ItemInfo.Find(x => x.ItemID == ID).ItemInx ?? "Unknown";
                case 2: return Program.ResSystem.MobInfo.Find(x => x.MobID == ID).MobInx ?? "Unknown";
                case 3: return Program.ResSystem.MapInfo.Find(x => x.MapID == ID).MapInx ?? "Unknown";
                default: return "Unknown";
            }
        }
    }

    public enum FindType : byte
    {
        ItemInfo = 1,
        MobInfo = 2,
        MapInfo = 3,
        HairInfo = 4,
        HairColorInfo = 5,
        FaceInfo = 6
    }
}
