1
0

playerCard.cpp 837 B

12345678910111213141516171819202122232425262728293031
  1. #include "playerCard.h"
  2. PlayerCard::PlayerCard(std::string name)
  3. {
  4. // make 12 boxes for each colored row (not the white ones)
  5. for(int j = 0; j<white1; j++)
  6. {
  7. std::vector<bool> empty;
  8. rowColors.push_back(empty);
  9. for (int i = 0; i<CHECKBOXES; i++)
  10. {
  11. rowColors[j].push_back(false);
  12. }
  13. }
  14. // initialize player selection (this is player's current selected checkbox)
  15. std::vector<int> t;
  16. t.push_back(0);
  17. selection.push_back(t);
  18. t.push_back(0);
  19. selection.push_back(t);
  20. selection.push_back(t);
  21. savedName = name;
  22. penaltyCount = 0;
  23. }
  24. void PlayerCard::newSelection()
  25. {
  26. selection[penalty][0] = 0;
  27. selection[everyone][row] = -1;
  28. selection[everyone][column] = -1;
  29. selection[active][row] = -1;
  30. selection[active][column] = -1;
  31. }