Here's another possibility:
Give your base class an 'execute_command' function which takes one parameter (an instance of a 'command' class). Now, redefine 'execute_command' in the derived classes to only execute the commands that it knows about.
For example:
The online game will be looking for a set_ip_command (using dynamic_cast in execute_command()), and will handle it accordingly. The offline game will not recognize the command, and simply discard it.Code:class command { }; class set_ip_command : public command { public: set_ip_command(std::string ip_address); }; ... ... some other block of code ... TTT* game1 = new OnlineGame; TTT* game2 = new OfflineGame; game1->execute_command(set_ip_command("1.1.1.1")); game2->execute_command(set_ip_command("1.1.1.1"));