namespace NHSE.Core
{
    /// <summary>
    /// Customization fabric used for an <see cref="Item"/>, sourced from the Able Sisters
    /// </summary>
    public enum ItemRemakeCommonPattern : byte
    {
        DotSmall00 = 0,
        DotSmall01 = 1,
        DotSmall02 = 2,
        DotSmall03 = 3,
        DotMedium00 = 4,
        DotMedium01 = 5,
        DotMedium02 = 6,
        DotMedium03 = 7,
        DotStar00 = 8,
        DotStar01 = 9,
        DotStar02 = 10,
        DotStar03 = 11,
        DotRandom00 = 12,
        DotRandom01 = 13,
        DotRandom02 = 14,
        DotRandom03 = 15,
        DotBig00 = 16,
        DotBig01 = 17,
        DotBig02 = 18,
        DotBig03 = 19,
        StripeSingle00 = 20,
        StripeSingle01 = 21,
        StripeSingle02 = 22,
        StripeSingle03 = 23,
        StripeSixth00 = 24,
        StripeSixth01 = 25,
        StripeSixth02 = 26,
        StripeSixth03 = 27,
        StripeRainbow00 = 28,
        StripeRainbow01 = 29,
        StripeRainbow02 = 30,
        StripeRainbow03 = 31,
        BorderMulti00 = 32,
        BorderMulti01 = 33,
        StripeDiagonal00 = 34,
        StripeDiagonal01 = 35,
        StripeChevron00 = 36,
        StripeChevron01 = 37,
        StripeWave00 = 38,
        StripeWave01 = 39,
        CheckGingham00 = 40,
        CheckGingham01 = 41,
        CheckGingham02 = 42,
        CheckGingham03 = 43,
        CheckBuffalo00 = 44,
        CheckBuffalo01 = 45,
        CheckBuffalo02 = 46,
        CheckBuffalo03 = 47,
        CheckPunk00 = 48,
        CheckPunk01 = 49,
        CheckPunk02 = 50,
        CheckPunk03 = 51,
        CheckGraph00 = 52,
        CheckGraph01 = 53,
        CheckGraph02 = 54,
        CheckGraph03 = 55,
        CheckShirt00 = 56,
        CheckShirt01 = 57,
        CheckShirt02 = 58,
        CheckShirt03 = 59,
        CheckMadras00 = 60,
        CheckMadras01 = 61,
        CheckMadras02 = 62,
        CheckMadras03 = 63,
        CheckDiagonal00 = 64,
        CheckDiagonal01 = 65,
        CheckTartan00 = 66,
        CheckTartan01 = 67,
        Damond00 = 68,
        Damond01 = 69,
        Argyle00 = 70,
        Argyle01 = 71,
        CheckHouse00 = 72,
        CheckHouse01 = 73,
        CheckGunclub00 = 74,
        CheckGunclub01 = 75,
        CheckChidori00 = 76,
        CheckChidori01 = 77,
        CheckChidori02 = 78,
        CheckChidori03 = 79,
        Ya00 = 80,
        Ya01 = 81,
        Karakusa00 = 82,
        Karakusa01 = 83,
        Koume00 = 84,
        Koume01 = 85,
        Ume00 = 86,
        Ume01 = 87,
        China00 = 88,
        China01 = 89,
        Tonbo00 = 90,
        Tonbo01 = 91,
        Kamawanu00 = 92,
        Kamawanu01 = 93,
        Igeta00 = 94,
        Igeta01 = 95,
        Sashiko00 = 96,
        Sashiko01 = 97,
        Zyuzi00 = 98,
        Zyuzi01 = 99,
        Chimayo00 = 100,
        Chimayo01 = 101,
        Ginkgo00 = 102,
        Ginkgo01 = 103,
        Snow00 = 104,
        Snow01 = 105,
        Nordic00 = 106,
        Nordic01 = 107,
        Swirl00 = 108,
        Swirl01 = 109,
        Water00 = 110,
        Water01 = 111,
        Geometry00 = 112,
        Geometry01 = 113,
        Square00 = 114,
        Square01 = 115,
        Paisley00 = 116,
        Paisley01 = 117,
        Tropical00 = 118,
        Tropical01 = 119,
        LegendFlower00 = 120,
        LegendFlower01 = 121,
        Jasmine00 = 122,
        Jasmine01 = 123,
        RetroFlower00 = 124,
        RetroFlower01 = 125,
        ColorfulFlower00 = 126,
        ColorfulFlower01 = 127,
        Monogram00 = 128,
        Monogram01 = 129,
        Psyche00 = 130,
        Psyche01 = 131,
        Apple00 = 132,
        Apple01 = 133,
        Himawari00 = 134,
        Himawari01 = 135,
        Hiyoko00 = 136,
        Hiyoko01 = 137,
        Retro00 = 138,
        Retro01 = 139,
        Flower00 = 140,
        Flower01 = 141,
        Ameba00 = 142,
        Ameba01 = 143,
        Suzuran00 = 144,
        Suzuran01 = 145,
        Uroko00 = 146,
        Uroko01 = 147,
        Clover00 = 148,
        Clover01 = 149,
        House00 = 150,
        House01 = 151,
        Rose00 = 152,
        Rose01 = 153,
        Bird00 = 154,
        Bird01 = 155,
        Wood00 = 156,
        Wood01 = 157,
        Yacht00 = 158,
        Yacht01 = 159,
        Pizza00 = 160,
        Pizza01 = 161,
        Skull00 = 162,
        Skull01 = 163,
        Donut00 = 164,
        Donut01 = 165,
        Space00 = 166,
        Space01 = 167,
        Sushi00 = 168,
        Sushi01 = 169,
        Star00 = 170,
        Star01 = 171,
        Lightning00 = 172,
        Lightning01 = 173,
        Hibiscus00 = 174,
        Hibiscus01 = 175,
        Marine00 = 176,
        Marine01 = 177,
        Puzzle00 = 178,
        Puzzle01 = 179,
        Tile00 = 180,
        Tile01 = 181,
        Dazzle00 = 182,
        Dazzle01 = 183,
        Giraffe00 = 184,
        Giraffe01 = 185,
        Leopard00 = 186,
        Leopard01 = 187,
        Zebra00 = 188,
        Zebra01 = 189,
        Dalmatian00 = 190,
        Dalmatian01 = 191,
        Python00 = 192,
        Python01 = 193,
        Camo00 = 194,
        Camo01 = 195,
        Ganshizin00 = 196,
        Ganshizin01 = 197,
        Dancer00 = 198,
        Dancer01 = 199,
    }

    public static class ItemRemakeCommonPatternExtensions
    {
        // The game is nice and evenly has 20/category, in order.
        private const int PatternsPerCategory = 20;

        public static ItemRemakeCommonPatternCategory GetCategory(this ItemRemakeCommonPattern p)
        {
            var val = (byte) p;
            var category = val / PatternsPerCategory;
            return (ItemRemakeCommonPatternCategory)category;
        }
    }
}
