Пример #1
0
        private TextureSet randomTextureSetFromDayNumber(int dayNumber)
        {
            // 4 texture sets, add a new one into the mix every 10 days -- hence the mod 41 here
            // (41 instead of 40, as day isn't zero indexed -- it begins at 1!)
            int dayNumWithinBounds = dayNumber % 41;

            if (dayNumWithinBounds <= 10)
            {
                // just normal
                return(TextureSet.Normal);
            }
            else if (dayNumWithinBounds <= 20)
            {
                // add kanji in
                return(RandUtil.From(TextureSet.Normal, TextureSet.Kanji));
            }
            else if (dayNumWithinBounds <= 30)
            {
                // add downer in
                return(RandUtil.From(TextureSet.Normal, TextureSet.Kanji, TextureSet.Downer));
            }
            else if (dayNumWithinBounds <= 40)
            {
                // full choice!
                return(RandUtil.RandomEnum <TextureSet>());
            }

            // TODO: randomly introduce the glitch texture set

            // shouldn't get here due to the mod 41, but we need a default return otherwise C# will moan!
            return(TextureSet.Normal);
        }