Here is my use case: I implement a game called 7 Wonders Duel.
There are 23 buildings in the Age I deck. All unique.
Buildings have different types. Types lead to different effects in the game.
Using Enum, the building type is a property of the building:
GARRISON(type = MILITARY)
I can easily get the enum values to shuffle the deck and start the game.
Using a Sealed class, all the building become “object” types. The building types are now classes or interfaces:
object Garrison: MilitaryBuilding
This looks a better object-oriented design to me, however, I need to maintain the list of all buildings somewhere to be able to shuffle the deck.
I know that sealed class offer much more features, but my use case here only requires a better enum So, if I could list all “object” instances of a sealed class, it would save me the trouble of listing it manually.
Does it looks like a valid use case to you?
Thanks,
Romain