public void Init(int totalWaves) { var infos = _randomFlockReader.GetByPresence(this); _fsm.Push(CreatePortalState()); var boss = infos.Where(i => i.lastWave).RandomElement(); if (boss != null) { _fsm.Push(CreateWaveState(new[] { boss }, true)); } var normalFlocks = infos.Where(i => !i.lastWave).ToArray(); if (normalFlocks.Length <= 0) { return; } for (var i = 0; i < totalWaves; i++) { _fsm.Push(CreateWaveState(normalFlocks.RandomElement(Configuration.maxRandomFlock), false)); } }
public RoamingPresence(IZone zone, PresenceConfiguration configuration) : base(zone, configuration) { _fsm = new StackFSM(); _fsm.Push(new SpawnState(this)); }
protected Egg() { _fsm = new StackFSM(); _fsm.Push(new WaitForSummonersState(this)); }