Initial commit
This commit is contained in:
16
src/Library/Items/BattleItemCategory.hpp
Normal file
16
src/Library/Items/BattleItemCategory.hpp
Normal file
@@ -0,0 +1,16 @@
|
||||
#ifndef CREATURELIB_BATTLEITEMCATEGORY_HPP
|
||||
#define CREATURELIB_BATTLEITEMCATEGORY_HPP
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
namespace CreatureLib::Library {
|
||||
enum class BattleItemCategory : uint8_t {
|
||||
None,
|
||||
Healing,
|
||||
StatusHealing,
|
||||
CaptureDevice,
|
||||
MiscBattleItem
|
||||
};
|
||||
}
|
||||
|
||||
#endif //CREATURELIB_BATTLEITEMCATEGORY_HPP
|
||||
5
src/Library/Items/Item.cpp
Normal file
5
src/Library/Items/Item.cpp
Normal file
@@ -0,0 +1,5 @@
|
||||
#include "Item.hpp"
|
||||
|
||||
bool CreatureLib::Library::Item::HasFlag(const std::string& flag) const {
|
||||
return this->_flags.find(flag) != this->_flags.end();
|
||||
}
|
||||
26
src/Library/Items/Item.hpp
Normal file
26
src/Library/Items/Item.hpp
Normal file
@@ -0,0 +1,26 @@
|
||||
#ifndef CREATURELIB_ITEM_HPP
|
||||
#define CREATURELIB_ITEM_HPP
|
||||
|
||||
#include <string>
|
||||
#include <unordered_set>
|
||||
#include "ItemCategory.hpp"
|
||||
#include "BattleItemCategory.hpp"
|
||||
#include "../../GenericTemplates.cpp"
|
||||
|
||||
namespace CreatureLib::Library {
|
||||
class Item {
|
||||
GetProperty(std::string, Name);
|
||||
GetProperty(ItemCategory, Category);
|
||||
GetProperty(BattleItemCategory, BattleCategory);
|
||||
GetProperty(int32_t , Price);
|
||||
private:
|
||||
std::unordered_set<std::string> _flags;
|
||||
public:
|
||||
Item(std::string name, ItemCategory category, BattleItemCategory battleCategory, int32_t price,
|
||||
std::unordered_set<std::string> flags);
|
||||
|
||||
bool HasFlag(const std::string& flag) const;
|
||||
};
|
||||
}
|
||||
|
||||
#endif //CREATURELIB_ITEM_HPP
|
||||
19
src/Library/Items/ItemCategory.hpp
Normal file
19
src/Library/Items/ItemCategory.hpp
Normal file
@@ -0,0 +1,19 @@
|
||||
#ifndef CREATURELIB_ITEMCATEGORY_HPP
|
||||
#define CREATURELIB_ITEMCATEGORY_HPP
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
namespace CreatureLib::Library{
|
||||
enum class ItemCategory : uint8_t {
|
||||
MiscItem,
|
||||
CaptureDevice,
|
||||
Medicine,
|
||||
Berry,
|
||||
TM,
|
||||
VariantChanger,
|
||||
KeyItem,
|
||||
Mail,
|
||||
};
|
||||
}
|
||||
|
||||
#endif //CREATURELIB_ITEMCATEGORY_HPP
|
||||
Reference in New Issue
Block a user