you really should be using Interfaces , if you already know that all entities use same common stuff why don't you make them drive from interface!
so eg:
why is that useful ? well say you have a Monster/Player/SobNpc those three entities can jump right? so why do you need to make 3 methods of jump for the three when you can have just one?
so it's easy now to deal with any type of entities yeah?
so eg:
Code:
class IEntity{ virtual public uint32_t getMapId() = 0; // getter virtual public void setMapId(uint32_t value) = 0; //setter virtual public uint16_t getX() = 0; // getter virtual public void setX(uint16_t value) = 0; //setter virtual public uint16_t getY() = 0; // getter virtual public void setY(uint16_t value) = 0; //setter //same for the common stuff }; class Hero : IEntity{ //then here it will force you to override the methods inside the IEntity.. };
Code:
void Jump(IEntity entity,uint32_t map, uint16_t toX, uint16_t toY){ entity.setMapId(map); entity.setX(toX); entity.setY(toY); //send packet to entity... }