fork download
  1. #include <iostream>
  2.  
  3. enum class Race { None, Living, Dead, Nature}; // always but invalid as the 0 entry.
  4.  
  5. class Player
  6. {
  7. uint32_t m_karma;
  8. bool m_myTurn;
  9. Race m_myRace;
  10.  
  11. public:
  12. void addPlayer(int x_)
  13. {
  14. std::cout << "added player " << x_ << std::endl;
  15. m_karma = 0;
  16. m_myTurn = false;
  17. m_myRace = Race::None;
  18. }
  19. };
  20.  
  21. int main(int argc, const char** argv)
  22. {
  23. Player fred;
  24. fred.addPlayer(1);
  25.  
  26. return 0;
  27. }
Success #stdin #stdout 0s 2852KB
stdin
Standard input is empty
stdout
added player 1