Last active
February 20, 2016 17:20
-
-
Save jacob-faber/1515545883b2b00f0e63 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Player { | |
public: | |
Player(); | |
virtual void who() = 0; | |
}; | |
class HumanPlayer: public Player { | |
void who() { ... }; | |
}; | |
class CpuPlayer: public Player { | |
void who() { ... }; | |
}; | |
Player *p1 = new HumanPlayer(); | |
Player *p2 = new CpuPlayer(); | |
p1->who(); | |
p1->who(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment