diff options
author | HampusM <hampus@hampusmat.com> | 2022-04-29 20:51:15 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-04-29 20:51:15 +0200 |
commit | 376ef270b255256b4154eafaea3530ab01e7ccc5 (patch) | |
tree | 823d4ffa69890e89b5d887e9751bffa49078702f /examples/basic/src/basic_example.cpp | |
parent | 41866b0febe36ca2f7d6c02ffce0ffea3f0ce425 (diff) |
docs: add factory to basic examplev0.1.2
Diffstat (limited to 'examples/basic/src/basic_example.cpp')
-rw-r--r-- | examples/basic/src/basic_example.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/examples/basic/src/basic_example.cpp b/examples/basic/src/basic_example.cpp index f85ed2d..6f3e15c 100644 --- a/examples/basic/src/basic_example.cpp +++ b/examples/basic/src/basic_example.cpp @@ -12,7 +12,9 @@ int main() std::cout << "Created a hero\n"; - auto enemy = container.get<IEnemy>(); + auto enemy_factory = container.get<IEnemyFactory>(); + + auto enemy = enemy_factory(); std::cout << "Created a enemy with " << enemy->get_health() << " in health\n"; |