diff options
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; +} |