Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "Stats.h"
- #include<iostream>
- Stats::Stats(int health, int attack, int defense, int skill)
- {
- m_health = health;
- m_attack = attack;
- m_defense = defense;
- m_skill = skill;
- }
- void Stats::incrementDefense(int defenseIncrement)
- {
- if(defenseIncrement < 0)
- {
- defenseIncrement = 0;
- std::cout << "Please Enter a Positive Integer!";
- }
- m_defense += defenseIncrement;
- }
- void Stats::incrementAttack(int attackIncrement)
- {
- if(attackIncrement < 0)
- {
- attackIncrement = 0;
- std::cout << "Please enter a Positive Integer!";
- }
- m_attack += attackIncrement;
- }
- void Stats::incrementHealth(int healthIncrement)
- {
- if(healthIncrement < 0)
- {
- healthIncrement = 0;
- std::cout<< "Please enter a Positive Integer!";
- }
- m_health += healthIncrement;
- }
- void Stats::printStats()
- {
- std::cout << "HP: " << m_health << " Attack: " << m_attack << " Defense: "
- << m_defense << " Skill: " << m_skill << std::endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement