Skip to main content
GameDev.net gamedev.net
🔒 Locked

Identifying events

Started by Nanook Jan 7, 2012 at 11:53 PM 0 replies 900+ views
Original Post
Nanook
Nanook
I need a efficient way of identifieng events..

atm I have a event class;



class Event
{
public:
Event(int eventId)
:
m_eventId(eventId)
{
}
private:
int m_eventId;
}


When users write events they do it like this:


enum
{
kCustomEvent = 'cste'
}

class CustomEvent
{
CustomEvent()
:
Event(kCustomEvent)
{
}
}


This is an idea I got from using the C4 Engine.. Its efficient to use integers like this, but Its dangerous as events might be called the same using the four letter char.. I could use strings, but hashing and comparing them wouldn't be as efficient..

Any tips on how I could do this?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.