Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
SpaceAdventureRPG/Consumable.cpp
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
49 lines (39 sloc)
1.25 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "Consumable.h" | |
Consumable::Consumable(int id) : Item(id) { | |
this->setItemType("Consumable"); | |
} | |
/* implementation of class Consumables constructor */ | |
Consumable::Consumable(Item item){ | |
this->setItemID(item.getItemID()); | |
this->setItemType("Consumable"); | |
this->setItemName(item.getItemName()); | |
this->setItemInventorySize(item.getItemInventorySize()); | |
this->setIsStackable(item.getIsStackable()); | |
this->setItemValue(item.getItemValue()); | |
} | |
/* implementation of setter methods of Consumable class */ | |
void Consumable::setHealthRegen(int healthRegen) { | |
this->healthRegen = healthRegen; | |
} | |
void Consumable::setShieldRegen(int shieldRegen) { | |
this->shieldRegen = shieldRegen; | |
} | |
void Consumable::setHealthBoost(int healthBoost) { | |
this->healthBoost = healthBoost; | |
} | |
void Consumable::setShieldBoost(int shieldBoost) { | |
this->shieldBoost = shieldBoost; | |
} | |
/* implementation of getter methods of Consumable class */ | |
int Consumable::getHealthRegen() { | |
return this->healthRegen; | |
} | |
int Consumable::getShieldRegen() { | |
return this->shieldRegen; | |
} | |
int Consumable::getHealthBoost() { | |
return this->healthBoost; | |
} | |
int Consumable::getShieldBoost() { | |
return this->shieldBoost; | |
} |