aboutsummaryrefslogtreecommitdiff
path: root/examples/basic/src/basic_example.cpp
blob: f85ed2d83c79cce74d581f5eb6568001fb5c90a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include "bootstrap.hpp"
#include "interfaces/enemy.hpp"
#include "interfaces/hero.hpp"

#include <iostream>

int main()
{
	auto container = bootstrap();

	auto hero = container.get<IHero>();

	std::cout << "Created a hero\n";

	auto enemy = container.get<IEnemy>();

	std::cout << "Created a enemy with " << enemy->get_health() << " in health\n";

	hero->fight(*enemy);

	std::cout << "The hero hit the enemy! The enemy now has " << enemy->get_health()
			  << " in health\n";
}