From 6398565e9ce51f86c02ac4db821ffe181452037f Mon Sep 17 00:00:00 2001 From: Aki Date: Sun, 8 Jan 2023 00:48:38 +0100 Subject: Extracted alive state check from battle to hitpoints to hide it away --- sim/src/HitPoints.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'sim/src/HitPoints.cpp') diff --git a/sim/src/HitPoints.cpp b/sim/src/HitPoints.cpp index 4f2ff81..da980f1 100644 --- a/sim/src/HitPoints.cpp +++ b/sim/src/HitPoints.cpp @@ -14,5 +14,12 @@ HitPoints::deal(double damage) } +bool +HitPoints::is_alive() const +{ + return health > 0.0; +} + + } // namespace sim } // namespace kurator -- cgit v1.1