10 ItemStats(
int acc = 0,
int dam = 0,
int aspd = 0,
int rng = 0,
int arm = 0,
int dod = 0) :
accuracy(acc),
damage(dam),
attackSpeed(aspd),
range(rng),
armor(arm),
dodge(dod){};
34 os <<
"ItemStats: accuracy = " << stats.
accuracy <<
", damage = " << stats.
damage <<
", attackSpeed = " << stats.
attackSpeed <<
", range = " << stats.
range <<
", armor = " << stats.
armor <<
", dodge = " << stats.
dodge << std::endl;
std::ostream & operator<<(std::ostream &os, const ItemStats &stats)
Definition: ItemReader.hpp:32
GameItems fetchItems()
Reads items defined in the items.json file and returns them as a GameItems struct....
Definition: ItemReader.cpp:14
ItemType
Definition: ItemReader.hpp:75
Slot
Definition: ItemReader.hpp:39
Definition: ItemReader.hpp:63
bool isStackable
Definition: ItemReader.hpp:66
Slot slot
Definition: ItemReader.hpp:64
ItemStats stats
Definition: ItemReader.hpp:65
Definition: ItemReader.hpp:70
int healAmount
Definition: ItemReader.hpp:71
Contains all the item data in the game. This is used to load item assets into memory and create item ...
Definition: ItemReader.hpp:87
const GeneralItemStruct & getGeneralItem(int id)
Definition: ItemReader.hpp:135
const EquippableItemStruct & getEquippableItem(int id)
Definition: ItemReader.hpp:140
std::map< int, EquippableItemStruct > equippableItems
Definition: ItemReader.hpp:89
const std::vector< int > getAllIds() const
Definition: ItemReader.hpp:97
const FoodItemStruct & getFoodItem(int id)
Definition: ItemReader.hpp:145
std::map< int, GeneralItemStruct > generalItems
Definition: ItemReader.hpp:88
const bool containsId(const int id) const
Definition: ItemReader.hpp:92
std::optional< ItemType > getItemType(int id)
Definition: ItemReader.hpp:115
std::map< int, FoodItemStruct > foodItems
Definition: ItemReader.hpp:90
Definition: ItemReader.hpp:52
std::string description
Definition: ItemReader.hpp:55
int id
Definition: ItemReader.hpp:53
std::string name
Definition: ItemReader.hpp:54
std::string iconFilename
Definition: ItemReader.hpp:59
std::string objFilename
Definition: ItemReader.hpp:58
bool isStackable
Definition: ItemReader.hpp:56
std::string textureFilename
Definition: ItemReader.hpp:57
Definition: ItemReader.hpp:9
friend std::ostream & operator<<(std::ostream &os, const ItemStats &stats)
Definition: ItemReader.hpp:32
int armor
Definition: ItemReader.hpp:20
int attackSpeed
Definition: ItemReader.hpp:16
ItemStats operator+(ItemStats other)
Definition: ItemReader.hpp:24
ItemStats(int acc=0, int dam=0, int aspd=0, int rng=0, int arm=0, int dod=0)
Definition: ItemReader.hpp:10
int dodge
Definition: ItemReader.hpp:22
int damage
Definition: ItemReader.hpp:14
int accuracy
Definition: ItemReader.hpp:10
int range
Definition: ItemReader.hpp:18