mercredi 1 avril 2015

How to do logic based on object ID

Suppose I have a game, where there are buildings sorted by type. Each type is represented as a separate class, but sometimes I have to do some uncommon logic for the buildings inside the same type. How could one implement this kind of behaviour? For example, I can identify buildings and have giant switch for concrete building ID. But I think that something is not right with this approach.


Aucun commentaire:

Enregistrer un commentaire