Using svector
This commit is contained in:
		
					parent
					
						
							
								e6bec5c0f2
							
						
					
				
			
			
				commit
				
					
						a164593cd8
					
				
			
		
					 2 changed files with 8 additions and 11 deletions
				
			
		| 
						 | 
				
			
			@ -10,6 +10,7 @@
 | 
			
		|||
#include <functional>
 | 
			
		||||
#include <variant>
 | 
			
		||||
#include <string_view>
 | 
			
		||||
#include <ankerl/svector.h>
 | 
			
		||||
#include "characteristic/characteristic.hpp"
 | 
			
		||||
 | 
			
		||||
// helper type for the visitor
 | 
			
		||||
| 
						 | 
				
			
			@ -45,7 +46,7 @@ namespace character {
 | 
			
		|||
    class BillyObjects final {
 | 
			
		||||
    public:
 | 
			
		||||
        using billyObject = std::variant<weapons, equipments, tools>;
 | 
			
		||||
        using container = std::array<billyObject, 3>;
 | 
			
		||||
        using container = ankerl::svector<billyObject, 3>;
 | 
			
		||||
 | 
			
		||||
        static constexpr std::string_view sword{ "Sword" };
 | 
			
		||||
        static constexpr std::string_view lance{ "Lance" };
 | 
			
		||||
| 
						 | 
				
			
			@ -68,9 +69,7 @@ namespace character {
 | 
			
		|||
 | 
			
		||||
        void pop_object(CharacterSheet &sheet) noexcept;
 | 
			
		||||
 | 
			
		||||
        [[nodiscard]] std::pair<const container &, std::int8_t> get_objects() const noexcept {
 | 
			
		||||
            return { objects, end_object };
 | 
			
		||||
        }
 | 
			
		||||
        [[nodiscard]] const container &get_objects() const noexcept { return objects; }
 | 
			
		||||
 | 
			
		||||
//        void insert_weapon(weapons weapon, CharacterSheet &sheet) noexcept;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -78,7 +77,6 @@ namespace character {
 | 
			
		|||
        container objects;
 | 
			
		||||
        std::plus<std::uint32_t> plus;
 | 
			
		||||
        std::minus<std::uint32_t> minus;
 | 
			
		||||
        std::uint8_t end_object{ 0 };
 | 
			
		||||
 | 
			
		||||
        static void change_carac_weapon(const weapons &arg,
 | 
			
		||||
                CharacterSheet &sheet,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue