Original Post
Ok first let me explain the current system I have.I have a base Entity class in my game and other game objects derive from this class.Pretty standart stuff.The entity class has a pure virtual method called getType() every class that inherits from Entity implements this and returns an unsigned integer or enum.The values they can return are defined in an enum like this : namespace EntityTypes { enum types { BUILDING, OBJECT, UNIT, ITEM, SPAWNER, DUNGEON //etc. }; } So for example the Building class has a method like this : unsigned int getType()const {return EntityTypes::BUILDING;} In lots of places in my code I need to check the type of the entity and do stuff based on that.Also all classes that derive from entity can have different types too,but at the moment they dont have derive they just have a m_Type member.For example the Unit class return EntityTypes::UNIT and has a m_UnitType member which can be anything from : namespace UnitTypes { enum types { VILLAGER, SWORDSMAN, //change to sth else ARCHER, //change so sth else later TRAINER, GOBLIN, PLAYER, TRADER, ANIMAL, STABLEMASTER, UNIT_TYPE_COUNT }; } So is there anyway to remove this system or any alternatives? It works for now and I kinda need these values when I write the entities to disk.And when loading back I read the entity type and create the entity based on the type I read from file.