diff options
Diffstat (limited to 'examples/basic/src/interfaces')
-rw-r--r-- | examples/basic/src/interfaces/enemy.hpp | 6 | ||||
-rw-r--r-- | examples/basic/src/interfaces/enemy_creator.hpp | 5 | ||||
-rw-r--r-- | examples/basic/src/interfaces/hero.hpp | 1 | ||||
-rw-r--r-- | examples/basic/src/interfaces/weapon.hpp | 3 |
4 files changed, 11 insertions, 4 deletions
diff --git a/examples/basic/src/interfaces/enemy.hpp b/examples/basic/src/interfaces/enemy.hpp index 5f49ca6..5ad7d90 100644 --- a/examples/basic/src/interfaces/enemy.hpp +++ b/examples/basic/src/interfaces/enemy.hpp @@ -4,15 +4,19 @@ #include <memory> +// NOLINTNEXTLINE(modernize-avoid-c-arrays, cppcoreguidelines-avoid-c-arrays) constexpr char SMALL_ENEMY_TAG[] = "small"; + +// NOLINTNEXTLINE(modernize-avoid-c-arrays, cppcoreguidelines-avoid-c-arrays) constexpr char BIG_ENEMY_TAG[] = "big"; +// NOLINTNEXTLINE(cppcoreguidelines-special-member-functions) class IEnemy { public: virtual ~IEnemy() noexcept = default; - virtual int get_health() const noexcept = 0; + [[nodiscard]] virtual auto get_health() const noexcept -> int = 0; virtual void do_damage(int damage) noexcept = 0; }; diff --git a/examples/basic/src/interfaces/enemy_creator.hpp b/examples/basic/src/interfaces/enemy_creator.hpp index 820b636..2675fea 100644 --- a/examples/basic/src/interfaces/enemy_creator.hpp +++ b/examples/basic/src/interfaces/enemy_creator.hpp @@ -4,12 +4,13 @@ #include <memory> +// NOLINTNEXTLINE(cppcoreguidelines-special-member-functions) class IEnemyCreator { public: virtual ~IEnemyCreator() = default; - virtual std::unique_ptr<IEnemy> create_small_enemy() noexcept = 0; + virtual auto create_small_enemy() noexcept -> std::unique_ptr<IEnemy> = 0; - virtual std::unique_ptr<IEnemy> create_big_enemy() noexcept = 0; + virtual auto create_big_enemy() noexcept -> std::unique_ptr<IEnemy> = 0; }; diff --git a/examples/basic/src/interfaces/hero.hpp b/examples/basic/src/interfaces/hero.hpp index 25e18fc..41441d6 100644 --- a/examples/basic/src/interfaces/hero.hpp +++ b/examples/basic/src/interfaces/hero.hpp @@ -2,6 +2,7 @@ #include "interfaces/enemy.hpp" +// NOLINTNEXTLINE(cppcoreguidelines-special-member-functions) class IHero { public: diff --git a/examples/basic/src/interfaces/weapon.hpp b/examples/basic/src/interfaces/weapon.hpp index 7404115..78e4f42 100644 --- a/examples/basic/src/interfaces/weapon.hpp +++ b/examples/basic/src/interfaces/weapon.hpp @@ -1,9 +1,10 @@ #pragma once +// NOLINTNEXTLINE(cppcoreguidelines-special-member-functions) class IWeapon { public: virtual ~IWeapon() noexcept = default; - virtual int get_strength() const noexcept = 0; + [[nodiscard]] virtual auto get_strength() const noexcept -> int = 0; }; |