Creating easily objects
This commit is contained in:
		
					parent
					
						
							
								f7862f09f9
							
						
					
				
			
			
				commit
				
					
						0b2467475a
					
				
			
		
					 2 changed files with 3 additions and 22 deletions
				
			
		| 
						 | 
				
			
			@ -68,13 +68,11 @@ namespace character {
 | 
			
		|||
 | 
			
		||||
    using billyObjects = std::unique_ptr<GenericObject>;
 | 
			
		||||
 | 
			
		||||
    static billyObjects new_object(const billyEnums &inputObject) noexcept;
 | 
			
		||||
 | 
			
		||||
    class Weapons final : virtual public GenericObject {
 | 
			
		||||
    public:
 | 
			
		||||
        const weapons type{ weapons::Sword };
 | 
			
		||||
 | 
			
		||||
        friend billyObjects new_object(const billyEnums &inputObject) noexcept;
 | 
			
		||||
        explicit Weapons(const weapons type) : type(type) {}
 | 
			
		||||
 | 
			
		||||
        Weapons() = delete;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -91,16 +89,13 @@ namespace character {
 | 
			
		|||
        [[nodiscard]] std::string_view to_string() const noexcept final;
 | 
			
		||||
 | 
			
		||||
        [[nodiscard]] billyEnums get_type() const noexcept final { return type; }
 | 
			
		||||
 | 
			
		||||
    private:
 | 
			
		||||
        explicit Weapons(const weapons type) : type(type) {}
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    class Equipments final : virtual public GenericObject {
 | 
			
		||||
    public:
 | 
			
		||||
        const equipments type{ equipments::Chainmail };
 | 
			
		||||
 | 
			
		||||
        friend billyObjects new_object(const billyEnums &inputObject) noexcept;
 | 
			
		||||
        explicit Equipments(const equipments type) : type(type) {}
 | 
			
		||||
 | 
			
		||||
        Equipments() = delete;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -117,16 +112,13 @@ namespace character {
 | 
			
		|||
        [[nodiscard]] std::string_view to_string() const noexcept final;
 | 
			
		||||
 | 
			
		||||
        [[nodiscard]] billyEnums get_type() const noexcept final { return type; }
 | 
			
		||||
 | 
			
		||||
    private:
 | 
			
		||||
        explicit Equipments(const equipments type) : type(type) {}
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    class Tools final : virtual public GenericObject {
 | 
			
		||||
    public:
 | 
			
		||||
        const tools type{ tools::Fourche };
 | 
			
		||||
 | 
			
		||||
        friend billyObjects new_object(const billyEnums &inputObject) noexcept;
 | 
			
		||||
        explicit Tools(const tools type) : type(type) {}
 | 
			
		||||
 | 
			
		||||
        Tools() = delete;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -143,9 +135,6 @@ namespace character {
 | 
			
		|||
        [[nodiscard]] std::string_view to_string() const noexcept final;
 | 
			
		||||
 | 
			
		||||
        [[nodiscard]] billyEnums get_type() const noexcept final { return type; }
 | 
			
		||||
 | 
			
		||||
    private:
 | 
			
		||||
        explicit Tools(const tools type) : type(type) {}
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
} // character
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue