From 67967051f2967138dc8c0f60e86d29e8e45b6200 Mon Sep 17 00:00:00 2001 From: Pcornat Date: Mon, 10 Jan 2022 21:28:29 +0100 Subject: [PATCH] Max life point. --- include/characteristic/endurance.hpp | 9 ++++++++- src/characteristic/endurance.cpp | 4 ++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/include/characteristic/endurance.hpp b/include/characteristic/endurance.hpp index 9f75b20..d696e9c 100644 --- a/include/characteristic/endurance.hpp +++ b/include/characteristic/endurance.hpp @@ -8,12 +8,19 @@ #include namespace character::characteristic { - class Endurance { + class Endurance final { private: const std::uint32_t base{ 2 }; std::uint32_t carac{ 0 }; std::uint32_t materiel{ 0 }; std::uint32_t additional{ 0 }; + + public: + Endurance() noexcept = default; + + ~Endurance() noexcept = default; + + [[nodiscard]] std::uint32_t get_max_lp() const noexcept; }; } diff --git a/src/characteristic/endurance.cpp b/src/characteristic/endurance.cpp index a7002b0..77069d0 100644 --- a/src/characteristic/endurance.cpp +++ b/src/characteristic/endurance.cpp @@ -1 +1,5 @@ #include "characteristic/endurance.hpp" + +std::uint32_t character::characteristic::Endurance::get_max_lp() const noexcept { + return (base + carac + materiel + additional) * 3; +}