aboutsummaryrefslogtreecommitdiff
path: root/examples/basic/src/interfaces
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-04-29 20:51:15 +0200
committerHampusM <hampus@hampusmat.com>2022-04-29 20:51:15 +0200
commit376ef270b255256b4154eafaea3530ab01e7ccc5 (patch)
tree823d4ffa69890e89b5d887e9751bffa49078702f /examples/basic/src/interfaces
parent41866b0febe36ca2f7d6c02ffce0ffea3f0ce425 (diff)
docs: add factory to basic examplev0.1.2
Diffstat (limited to 'examples/basic/src/interfaces')
-rw-r--r--examples/basic/src/interfaces/enemy.hpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/examples/basic/src/interfaces/enemy.hpp b/examples/basic/src/interfaces/enemy.hpp
index 45e004f..40b6818 100644
--- a/examples/basic/src/interfaces/enemy.hpp
+++ b/examples/basic/src/interfaces/enemy.hpp
@@ -1,5 +1,9 @@
#pragma once
+#include <yacppdic/factory.hpp>
+
+#include <memory>
+
class IEnemy
{
public:
@@ -9,3 +13,5 @@ public:
virtual void do_damage(int damage) noexcept = 0;
};
+
+using IEnemyFactory = yacppdic::Factory<std::unique_ptr<IEnemy>()>;