]> git.dkaiser.de - 42/cpp01.git/commitdiff
Add and implement Weapon class
authorDominik Kaiser <dkaiser@student.42heilbronn.de>
Mon, 10 Feb 2025 11:21:03 +0000 (12:21 +0100)
committerDominik Kaiser <dkaiser@student.42heilbronn.de>
Mon, 10 Feb 2025 11:21:03 +0000 (12:21 +0100)
ex03/Weapon.cpp
ex03/Weapon.hpp

index 42bb132cfeeb3efbfbe98944c6b8573ee8168462..e9dde06c114682b295888322d8d4ba1f46813e20 100644 (file)
@@ -6,7 +6,21 @@
 /*   By: dkaiser <dkaiser@student.42heilbronn.de    +#+  +:+       +#+        */
 /*                                                +#+#+#+#+#+   +#+           */
 /*   Created: 2025/02/10 11:59:21 by dkaiser           #+#    #+#             */
-/*   Updated: 2025/02/10 11:59:21 by dkaiser          ###   ########.fr       */
+/*   Updated: 2025/02/10 12:11:07 by dkaiser          ###   ########.fr       */
 /*                                                                            */
 /* ************************************************************************** */
 
+#include "Weapon.hpp"
+
+Weapon::Weapon(void)
+{}
+
+const std::string& Weapon::getType(void) const
+{
+    return this->type;
+}
+
+void Weapon::setType(const std::string &type)
+{
+    this->type = type;
+}
index ee8c29966ddf416df0545f8bd1896c2368b5a614..917b367511e5bd27ce62ba3103f2506944b35441 100644 (file)
@@ -6,11 +6,23 @@
 /*   By: dkaiser <dkaiser@student.42heilbronn.de    +#+  +:+       +#+        */
 /*                                                +#+#+#+#+#+   +#+           */
 /*   Created: 2025/02/10 11:58:44 by dkaiser           #+#    #+#             */
-/*   Updated: 2025/02/10 11:59:10 by dkaiser          ###   ########.fr       */
+/*   Updated: 2025/02/10 12:09:57 by dkaiser          ###   ########.fr       */
 /*                                                                            */
 /* ************************************************************************** */
 
 #ifndef WEAPON_H_
 #define WEAPON_H_
 
+#include <string>
+
+class Weapon
+{
+    public: 
+        Weapon(void);
+        const std::string& getType(void) const;
+        void setType(const std::string &type);
+    private:
+        std::string type;
+};
+
 #endif