]> git.dkaiser.de - 42/cpp01.git/commitdiff
Add HumanA and HumanB classes
authorDominik Kaiser <dkaiser@student.42heilbronn.de>
Mon, 10 Feb 2025 11:32:47 +0000 (12:32 +0100)
committerDominik Kaiser <dkaiser@student.42heilbronn.de>
Mon, 10 Feb 2025 11:32:47 +0000 (12:32 +0100)
ex03/HumanA.hpp
ex03/HumanB.hpp

index 0c8cde60e67dfc674f6fed0a609a4d9ca7691c02..b373665889047636aecd06ad76f71072dc79697f 100644 (file)
@@ -6,11 +6,24 @@
 /*   By: dkaiser <dkaiser@student.42heilbronn.de    +#+  +:+       +#+        */
 /*                                                +#+#+#+#+#+   +#+           */
 /*   Created: 2025/02/10 11:59:28 by dkaiser           #+#    #+#             */
-/*   Updated: 2025/02/10 11:59:50 by dkaiser          ###   ########.fr       */
+/*   Updated: 2025/02/10 12:25:54 by dkaiser          ###   ########.fr       */
 /*                                                                            */
 /* ************************************************************************** */
 
 #ifndef HUMANA_H_
 #define HUMANA_H_
 
+#include "Weapon.hpp"
+#include <string>
+
+class HumanA
+{
+    public:
+        HumanA(const std::string &name, const Weapon &weapon);
+        void attack(void) const;
+    private:
+        Weapon weapon;
+        std::string name;
+};
+
 #endif
index d8ccdc87324518c4af69b42c2a2a7fa2cd8627b1..ce4edbdc4ddc05106686ababfb8c4085a0efcb19 100644 (file)
@@ -6,11 +6,25 @@
 /*   By: dkaiser <dkaiser@student.42heilbronn.de    +#+  +:+       +#+        */
 /*                                                +#+#+#+#+#+   +#+           */
 /*   Created: 2025/02/10 12:00:55 by dkaiser           #+#    #+#             */
-/*   Updated: 2025/02/10 12:00:58 by dkaiser          ###   ########.fr       */
+/*   Updated: 2025/02/10 12:29:43 by dkaiser          ###   ########.fr       */
 /*                                                                            */
 /* ************************************************************************** */
 
 #ifndef HUMANB_H_
 #define HUMANB_H_
 
+#include "Weapon.hpp"
+#include <string>
+
+class HumanB
+{
+    public:
+        HumanB(const std::string &name);
+        void attack(void) const;
+        void setWeapon(Weapon *weapon);
+    private:
+        Weapon* weapon;
+        std::string name;
+};
+
 #endif