Switch on the runtime type of an Entity.
Game systems often dispatch by type. Build:
```csharp
abstract record Entity;
record Player(int HP) : Entity;
record Enemy(int Damage) : Entity;
```
Then a method `static string Describe(Entity e)` with a switch expression that pattern-matches `Player p` and `Enemy en` and returns a string mentioning their stats.
Sign in to save your code and track progress across devices.