From 82cc6d979d95443e4928bbbb33ec68f15ee8a65b Mon Sep 17 00:00:00 2001 From: newfrenchy83 Date: Mon, 21 Oct 2024 17:46:19 +0200 Subject: [PATCH] moves alignment_str() to header and correct documentation --- src/units/attack_type.cpp | 5 ----- src/units/attack_type.hpp | 4 ++-- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/units/attack_type.cpp b/src/units/attack_type.cpp index 1e9b99a19952..12a75a549cb3 100644 --- a/src/units/attack_type.cpp +++ b/src/units/attack_type.cpp @@ -82,11 +82,6 @@ attack_type::attack_type(const config& cfg) } } -std::string attack_type::alignment_str() const -{ - return alignment_ ? unit_alignments::get_string(*alignment()) : ""; -} - std::string attack_type::accuracy_parry_description() const { if(accuracy_ == 0 && parry_ == 0) { diff --git a/src/units/attack_type.hpp b/src/units/attack_type.hpp index 8daf792225b1..35afe1f4e04b 100644 --- a/src/units/attack_type.hpp +++ b/src/units/attack_type.hpp @@ -87,12 +87,12 @@ class attack_type : public std::enable_shared_from_this std::string weapon_specials() const; std::string weapon_specials_value(const std::set checking_tags) const; - /** Returns alignment specified by alignment_str_ variable If empty or not valid returns the unit's alignment or neutral if self_ variable empty. + /** Returns alignment specified by alignment_ variable. */ utils::optional alignment() const { return alignment_; } /** Returns alignment specified by alignment() for filtering when exist. */ - std::string alignment_str() const; + std::string alignment_str() const { return alignment_ ? unit_alignments::get_string(*alignment_) : ""; } /** Calculates the number of attacks this weapon has, considering specials. */ void modified_attacks(unsigned & min_attacks,