From 9fce9dd2c3cd1c0a75a5cfe74ea0484186247cc3 Mon Sep 17 00:00:00 2001 From: HampusM Date: Thu, 28 Apr 2022 22:03:07 +0200 Subject: docs: add basic example --- examples/basic/src/hero.hpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 examples/basic/src/hero.hpp (limited to 'examples/basic/src/hero.hpp') diff --git a/examples/basic/src/hero.hpp b/examples/basic/src/hero.hpp new file mode 100644 index 0000000..e4959d2 --- /dev/null +++ b/examples/basic/src/hero.hpp @@ -0,0 +1,19 @@ +#pragma once + +#include "interfaces/hero.hpp" +#include "interfaces/weapon.hpp" + +#include + +#include + +class Hero : public IHero, public yacppdic::AutoWirable +{ +public: + Hero(std::shared_ptr weapon) noexcept; + + void fight(IEnemy &enemy) noexcept override; + +private: + std::shared_ptr _weapon; +}; -- cgit v1.2.3-18-g5258