Ejemplo n.º 1
0
        public BossAttack <T> Next()
        {
            if (current == null)
            {
                current = patterns[Rnd.Int(patterns.Length)];
            }

            var a = current.Generate();

            if (a == null)
            {
                current = null;
                return(Next());
            }

            return(a);
        }
Ejemplo n.º 2
0
        public BossAttack <T> GetNext()
        {
            if (current != null)
            {
                var attack = current.Generate();

                if (attack != null)
                {
                    return(attack);
                }

                current = null;
            }

            // fixme: i suspect that rng is not right here
            var i = Rnd.Int(patterns.Length);

            Log.Error($"{i} {patterns.Length}");
            current = registry.Get(patterns[i]);

            return(GetNext());
        }