|Without knowing all the details of your problem, it seems like a case where object inheritance can help. Your objects can inherit from a base class, let’s say “entity” and reimplement various polymorphic functions.
For instance, each can have a
collide function that does different things depending on the specific type of object. On the other hand, all objects have a location on the game map so you might have a function
Entity::location() that returns the position of an object without having to reimplement it.
Also, your hierarchy might become more complicated as you find common traits between various classes of objects. You might have
FixedEntity that describes walls and other things that stay put, and
MobileEntity for players, dragons and what not.