GameSimulation gameObject;
gameObject << "some text";
and the game will output that text in a specific way. Well, that works fine if i do that in main. However, how do i do the same thing from within the class?
For example, here's a function in the class definition:
void GameSimulation::setUpNewPlayer(Player *player)
{ gameWorld[player->location[0]] [player->location[1]] = player->sprite;
???? << "New player has been set up. There are now " << playerList.size() << " players online\n";
}
What do I put in place of the question marks to make it use the GameSimulation::operator << (std::string textString) method that's in the same class? Thanks for your help.
Edit: I tried 'this' and '*this' and neither worked.