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); }
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()); }
public void Register(string id, BossPattern <T> pattern) { defined[id] = pattern; }