private void HandleEvent(TileEventInfo tileEventInfo) { switch (tileEventInfo.Type) { case TileEventType.PlayerKill: if (tileEventInfo.IsEasy) { parent?.Respawn(); if (parent is MovableTile movableTile) { movableTile.IsMoving = false; } } else { if (parent is PlayerTile) { EventManager.FireEvent(new TileEventInfo { Type = TileEventType.Reset, IsEasy = tileEventInfo.IsEasy }); } } break; } }
private void HandleTileEvent(TileEventInfo info) { if (info.Id == ID) { switch (info.Type) { case TileEventType.Reset: if (info.IsEasy) { Die(Respawn); } else { EventManager.FireEvent(new GameStateMessageEventInfo { GameState = GameState.Lost }); } break; case TileEventType.Consumed: Die(() => { EventManager.FireEvent(new RemoveActorEvent { actor3D = this }); }); break; } } }