public IEnemyLogicState HandleEvent(IGameObject gameObject, IGameWorld gameWorld, object gameEvent) { if (gameEvent is EnemyDestructionEnd) { gameWorld.Destroy(gameObject); } return(this); }
public void HandleEvent(IGameObject gameObject, IGameWorld gameWorld, object gameEvent) { if (gameEvent is IntersectionEvent) { var intersectonEvent = gameEvent as IntersectionEvent; var intersectionObject = intersectonEvent.IntersectionObject; intersectionObject.HandleEvent(gameWorld, new ShellHitEvent()); gameWorld.Destroy(gameObject); } }