diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/basic/src/bootstrap.cpp | 4 | ||||
-rw-r--r-- | examples/basic/src/interfaces/enemy.hpp | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/examples/basic/src/bootstrap.cpp b/examples/basic/src/bootstrap.cpp index 78c5a37..104cf51 100644 --- a/examples/basic/src/bootstrap.cpp +++ b/examples/basic/src/bootstrap.cpp @@ -24,7 +24,7 @@ auto bootstrap() -> yacppdic::Container .to_factory( []() { - return std::make_unique<Enemy>(65); + return std::make_unique<Enemy>(SMALL_ENEMY_HEALTH); } ) .when_tagged<SMALL_ENEMY_TAG>(); @@ -33,7 +33,7 @@ auto bootstrap() -> yacppdic::Container .to_factory( []() { - return std::make_unique<Enemy>(130); + return std::make_unique<Enemy>(BIG_ENEMY_HEALTH); } ) .when_tagged<BIG_ENEMY_TAG>(); diff --git a/examples/basic/src/interfaces/enemy.hpp b/examples/basic/src/interfaces/enemy.hpp index d0b6337..7132125 100644 --- a/examples/basic/src/interfaces/enemy.hpp +++ b/examples/basic/src/interfaces/enemy.hpp @@ -8,6 +8,9 @@ constexpr yacppdic::Tag SMALL_ENEMY_TAG = "small"; constexpr yacppdic::Tag BIG_ENEMY_TAG = "big"; +constexpr auto SMALL_ENEMY_HEALTH = 65; +constexpr auto BIG_ENEMY_HEALTH = 130; + // NOLINTNEXTLINE(cppcoreguidelines-special-member-functions) class IEnemy { |