Advertisement
L3peha

Untitled

Feb 19th, 2020
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. class Knight :public Player
  2. {
  3. public:
  4. bool canUse(Item* item)
  5. {
  6. if (item->isMagical() == 1)
  7. {
  8. return 0;
  9. }
  10. else if (this->strength >= item->getWeight() && this->getLevel() >= item->getLevel())
  11. {
  12. return 1;
  13. }
  14. else
  15. {
  16. return 0;
  17. }
  18. }
  19. };
  20.  
  21. class Wizard :public Player
  22. {
  23. public:
  24. bool canUse(Item* item)
  25. {
  26. if (this->strength >= item->getWeight() && this->getLevel() >= item->getLevel())
  27. {
  28. return 1;
  29. }
  30. else return 0;
  31. }
  32. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement