is there a warior i can do the following:
lets say i have
string userChoice;
assume i have a Warrior class with move function in it
is it possible to define :
#define WARRIOR "Warrior"
and than use
userChoice=WARRIOR;
and call the function
userChoice.move()
?
void play(char gameWorld[][BOARD_SIZE])
{
Warrior War(1,1);
int userChoice;
userChoice=getUserChoice();
string currentPlayer=WARRIOR;
while(userChoice!='q')
{
switch(userChoice)
{
case(50): ((string)currentPlayer).moveDirection(DOWN);
}
userChoice=getUserChoice();
}
}
it isnt working thanks
is it possible without using a vector? just a simple string C or something simpler? ty