Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Submit this file.
- // You must use this exact file name.
- #include "Fighter.h"
- using namespace std;
- Fighter::Fighter(){
- name = "NONE";
- str= 1;
- hp= 60;
- weapon="None";
- money=0;
- }
- Fighter::Fighter(string name,int str,int hp){
- this->name=name;
- this->str = str;
- this->hp=hp;
- money=1000;
- weapon=Weapon("NONE");
- }
- string Fighter::getName()const{
- return name;
- }
- int Fighter::getStr()const{
- return str;
- }
- int Fighter::getHp()const{
- return hp;
- }
- int Fighter::getMoney()const{
- return money;
- }
- Weapon& Fighter::getWeapon(){
- return weapon;
- }
- bool Fighter::setWeapon(const Weapon& weapon){
- this->weapon=weapon;
- this->weapon.setFighterName("this->name");
- return true;
- }
- bool Fighter::removeWeapon(){
- if(weapon=="None"){
- return false;
- }
- weapon.setFighterName="None";
- weapon="None";
- return true;
- }
- void Fighter::addMoney(int amount){
- money+=amount;
- }
- bool Fighter::removeMoney(int amount){
- if(money<=0){
- return false;
- }
- money-=amount;
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement