refactor: Rewrite BehaviorMessage classes to use member initialization, preferred member naming conventions, and const-ref getters (#1456)

* Split out BehaviorMessage class changes from PR #1452

* remove <string_view> inclusion in ActionContext.h

* add the arguments nullptr check back in

* remove redundant std::string constructor calls

* Update AddStripMessage.cpp - change push_back to emplace_back
This commit is contained in:
jadebenn
2024-02-18 00:38:26 -06:00
committed by GitHub
parent c7b3d9e817
commit b6af92ef81
46 changed files with 362 additions and 341 deletions

View File

@@ -7,19 +7,20 @@ class AMFArrayValue;
class BlockDefinition {
public:
BlockDefinition(std::string defaultValue = "", float minimumValue = 0.0f, float maximumValue = 0.0f);
BlockDefinition(const std::string& defaultValue = "", const float minimumValue = 0.0f, const float maximumValue = 0.0f);
static BlockDefinition blockDefinitionDefault;
std::string& GetDefaultValue() { return defaultValue; };
float GetMinimumValue() { return minimumValue; };
float GetMaximumValue() { return maximumValue; };
void SetDefaultValue(std::string value) { defaultValue = value; };
void SetMinimumValue(float value) { minimumValue = value; };
void SetMaximumValue(float value) { maximumValue = value; };
[[nodiscard]] const std::string& GetDefaultValue() const { return m_DefaultValue; }
[[nodiscard]] float GetMinimumValue() const noexcept { return m_MinimumValue; }
[[nodiscard]] float GetMaximumValue() const noexcept { return m_MaximumValue; }
void SetDefaultValue(const std::string& value) { m_DefaultValue = value; }
void SetMinimumValue(const float value) noexcept { m_MinimumValue = value; }
void SetMaximumValue(const float value) noexcept { m_MaximumValue = value; }
private:
std::string defaultValue;
float minimumValue;
float maximumValue;
std::string m_DefaultValue;
float m_MinimumValue;
float m_MaximumValue;
};
#endif //!__BLOCKDEFINITION__H__