Advertisement
Guest User

Untitled

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