Hello,
I wondered if it is possible to give a numerical type other than int to enums.
I know it is possible using a compiler flag, unfortunately this will change all enums' types.
I want to optimise the size they will take, and I know some of them will be smaller than 255, and others probably will need a short.
It is indeed annoying to declare a variable which contains the enum's value with the good type to create sf::Packets
For example, this is what I am doing now:
sf::Packet p;
static short head = DEFAULT_HEAD;
static char etype = GEVENT_SPAWN;
static char otype = OTYPE_NPC;
char* name=this->getFullName();
p<<head<<etype<<otype<<name;
return p;
what would be optimal:`
sf::Packet p;
char* name=this->getFullName();
p<<DEFAULT_HEAD<< GEVENT_SPAWN << OTYPE_NPC <<name;
return p;
Thanks for the ideas.