Early Bird Gets the Worm, but Second Mouse Gets the Cheese

Lots more work done on Tales of Phantasia last night, animations, NPC interaction and a bit more framework optimization. Screenshots to be added soon.

Not only did I do that, but I finally got around to putting the finishing touches to my event system, now it now the type of variable that is being set, and I also finally found a use for template functions (thats right, functions, not classes, didn’t know they existed til last month).

What use you say? Quick function overloading, not really much point, but it saves the hassle of type casts. I’m currently using a 32bit unsigned integer for storing the variable type, which gives me 32 potential arguments for my events, I only use 5 at the moment, and I think I can remove one of them.

template<typename T>
void SetArgumentAsNumber( const unsigned int inIndex, const T inValue )
{
	Arg[inIndex].d = (double)inValue;
	m_type &= ~( 1 << inIndex );
}
 
void SetArgumentAsString( const unsigned int inIndex, const char *string )
{
	Arg[inIndex].text = string;
	m_type |= ( 1 << inIndex );
}
 
bool IsArgumentAString( const unsigned int inIndex ) const
{
	return ( m_type & ( 1 << inIndex ) ) ? true : false;
}