Ok basicly what im trying to do is brainstorm the best way to go about loading functions from a file... for example
Say you load a level file into your game (The game is an RPG by the way ) you talk to a person in that level and they could do a range of differernt actions...
This is the best idea iv'e had so far in getting this to work
Code:
class sprite
{ public:
int function[];
int string textarguments[]
int numberarguments[][]
};
and then something like...
Code:
sprite person[10];
if( user presses action key)
{
switch(person[0].function[x])
{
case '1':
a_function(person[0].textarguments[x])
break;
case '2':
another_function(person[0].numberrguments[x][y1], person[0]numberarguments[x][y2]);
break;
}//end of switch
}//end of if
however this seems like a very messy, wastefull and confusing way to go about things as there would be alot of unused elements of the arrays
Is there a better way to go about this? Have I explained this well enough?