diff options
author | HampusM <hampus@hampusmat.com> | 2022-04-28 22:03:07 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-04-28 22:03:34 +0200 |
commit | 9fce9dd2c3cd1c0a75a5cfe74ea0484186247cc3 (patch) | |
tree | 37184c6a8a5d94863a23e053631756f738b75bee /examples/basic/src/bootstrap.cpp | |
parent | 1f97ab2ef846462d7a599fbd3ac9415da8f0953b (diff) |
docs: add basic examplev0.1.0
Diffstat (limited to 'examples/basic/src/bootstrap.cpp')
-rw-r--r-- | examples/basic/src/bootstrap.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/examples/basic/src/bootstrap.cpp b/examples/basic/src/bootstrap.cpp new file mode 100644 index 0000000..fe59c5d --- /dev/null +++ b/examples/basic/src/bootstrap.cpp @@ -0,0 +1,22 @@ +#include "bootstrap.hpp" + +// Interfaces +#include "interfaces/enemy.hpp" +#include "interfaces/hero.hpp" +#include "interfaces/weapon.hpp" + +// Concretes +#include "enemy.hpp" +#include "hero.hpp" +#include "sword.hpp" + +yacppdic::Container bootstrap() +{ + auto container = yacppdic::Container(); + + container.bind<IHero>().to<Hero>(); + container.bind<IWeapon>().to<Sword>(); + container.bind<IEnemy>().to<Enemy>(); + + return container; +} |