/// <summary> /// MakeDying mmoves an enemy from the living collection to the dying collection (unless it hit the centre). /// The dying collection is used to store enemies until the AudioEngine is ready to make a sound for them. /// </summary> public void MakeDying(EnemyTimeWho etw) { Living.Remove(etw.enemy); //A 'who' of -1 signifies that the enemy was removed by reaching the centre, rather than being destroyed by a player if (etw.who > -1) { dying.Add(etw); } }
/// <summary> /// Kill is called by the AudioEngine and moves an enemy from dying to dead, which allows the VideoEngine /// to play its death animation, and also fires the DeadEnemy event. /// </summary> public void Kill(EnemyTimeWho etw) { dying.Remove(etw); if (DeadEnemy != null) { DeadEnemy(this, new EnemyArgs(etw.enemy)); } Players[etw.who].Killed(etw.enemy); dead.Add(new EnemyTimeWho(etw.enemy, LastUpdate, etw.who)); }
/// <summary> /// Cremate removes an enemy from the dead collection, and is called by the VideoEngine once the death /// animation is done. The enemy is then no longer referred to and is garbage-collected. /// </summary> public void Cremate(EnemyTimeWho etw) { dead.Remove(etw); }
/// <summary> /// Kill is called by the AudioEngine and moves an enemy from dying to dead, which allows the VideoEngine /// to play its death animation, and also fires the DeadEnemy event. /// </summary> public void Kill(EnemyTimeWho etw) { dying.Remove(etw); if (DeadEnemy != null) DeadEnemy(this, new EnemyArgs(etw.enemy)); Players[etw.who].Killed(etw.enemy); dead.Add(new EnemyTimeWho(etw.enemy, LastUpdate, etw.who)); }