aboutsummaryrefslogtreecommitdiff
path: root/examples/basic/src/hero.hpp
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-04-28 22:03:07 +0200
committerHampusM <hampus@hampusmat.com>2022-04-28 22:03:34 +0200
commit9fce9dd2c3cd1c0a75a5cfe74ea0484186247cc3 (patch)
tree37184c6a8a5d94863a23e053631756f738b75bee /examples/basic/src/hero.hpp
parent1f97ab2ef846462d7a599fbd3ac9415da8f0953b (diff)
docs: add basic examplev0.1.0
Diffstat (limited to 'examples/basic/src/hero.hpp')
-rw-r--r--examples/basic/src/hero.hpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/examples/basic/src/hero.hpp b/examples/basic/src/hero.hpp
new file mode 100644
index 0000000..e4959d2
--- /dev/null
+++ b/examples/basic/src/hero.hpp
@@ -0,0 +1,19 @@
+#pragma once
+
+#include "interfaces/hero.hpp"
+#include "interfaces/weapon.hpp"
+
+#include <yacppdic/auto_wirable.hpp>
+
+#include <memory>
+
+class Hero : public IHero, public yacppdic::AutoWirable<IHero, Hero, IWeapon>
+{
+public:
+ Hero(std::shared_ptr<IWeapon> weapon) noexcept;
+
+ void fight(IEnemy &enemy) noexcept override;
+
+private:
+ std::shared_ptr<IWeapon> _weapon;
+};