Initial commit

This commit is contained in:
2019-10-06 13:50:52 +02:00
commit 265923231f
44 changed files with 16258 additions and 0 deletions

View 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

View 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();
}

View 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

View 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