mercredi 8 décembre 2021

How to implement Singleton design pattern when class has subclasses?

I have a Player class for a game and there are different player types: Animal, Person, Robot. I want my game to have a single instance of a player using the Singleton pattern but not sure if this is possible?

enter image description here

Aucun commentaire:

Enregistrer un commentaire