// // Created by postaron on 20/02/24. // #ifndef BILLYSHEET_BILLY_OBJECTS_HPP #define BILLYSHEET_BILLY_OBJECTS_HPP #include #include #include #include #include #include #include "characteristic/characteristic.hpp" // helper type for the visitor template struct overloaded : Ts ... { using Ts::operator()...; }; template overloaded(Ts...) -> overloaded; namespace character { class CharacterSheet; enum class weapons : std::uint8_t { Sword = 0, Lance = 1, Morgenstern = 2, Bow = 3 }; enum class equipments : std::uint8_t { Chainmail = 0, CookingPot = 1, PamphletTourist = 2, MedicKit = 3, }; enum class tools : std::uint8_t { Fourche = 0, Dagger = 1, RockClimbingKit = 2, SackOfGrain = 3 }; class BillyObjects final { public: using billyObject = std::variant; using container = ankerl::svector; static constexpr std::string_view sword{ "Sword" }; static constexpr std::string_view lance{ "Lance" }; static constexpr std::string_view morgenstern{ "Morgenstern" }; static constexpr std::string_view bow{ "Bow" }; static constexpr std::string_view chainmail{ "Chainmail" }; static constexpr std::string_view cooking_pot{ "Cooking pot" }; static constexpr std::string_view pamphlet_tourist{ "Touristic pamphlet" }; static constexpr std::string_view medic_kit{ "Medic kit" }; static constexpr std::string_view fourche{ "Fourche" }; static constexpr std::string_view dagger{ "Dagger" }; static constexpr std::string_view rock_climbing_kit{ "Rock climbing kit" }; static constexpr std::string_view sack_of_grain{ "Sack of grain" }; static std::string_view billy_object_to_string(const billyObject &object) noexcept; void push_object(const billyObject &object, CharacterSheet &sheet) noexcept; void pop_object(CharacterSheet &sheet) noexcept; [[nodiscard]] const container &get_objects() const noexcept { return objects; } // void insert_weapon(weapons weapon, CharacterSheet &sheet) noexcept; private: container objects; std::plus plus; std::minus minus; static void change_carac_weapon(const weapons &arg, CharacterSheet &sheet, characteristic::Characteristic &localHabilete, characteristic::Characteristic &localAdresse, characteristic::Characteristic &localEndurance, const std::function &operation) noexcept; static void change_carac_equipment(const equipments &arg, CharacterSheet &sheet, characteristic::Characteristic &localHabilete, characteristic::Characteristic &localAdresse, characteristic::Characteristic &localEndurance, characteristic::Characteristic &localChance, const std::function &primary, const std::function &complement) noexcept; static void change_carac_tools(const tools &arg, CharacterSheet &sheet, characteristic::Characteristic &localHabilete, characteristic::Characteristic &localAdresse, characteristic::Characteristic &localEndurance, characteristic::Characteristic &localChance, const std::function &operation) noexcept; }; } #endif //BILLYSHEET_BILLY_OBJECTS_HPP