Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Knight :public Player
- {
- public:
- bool canUse(Item* item)
- {
- if (item->isMagical() == 1)
- {
- return 0;
- }
- else if (this->strength >= item->getWeight() && this->getLevel() >= item->getLevel())
- {
- return 1;
- }
- else
- {
- return 0;
- }
- }
- };
- class Wizard :public Player
- {
- public:
- bool canUse(Item* item)
- {
- if (this->strength >= item->getWeight() && this->getLevel() >= item->getLevel())
- {
- return 1;
- }
- else return 0;
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement