diff options
author | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-01-26 16:07:54 +0100 |
---|---|---|
committer | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-01-26 16:07:54 +0100 |
commit | 5afe88df2538274859a162ffd63ed52118e80c19 (patch) | |
tree | b610dfd58dc748fd63f49565b2a43eea2316714f /src/resources/attributes.cpp | |
parent | 73ba2a95f5bd4a0dd09af52d5864800be2b0a4c6 (diff) | |
download | mana-5afe88df2538274859a162ffd63ed52118e80c19.tar.gz mana-5afe88df2538274859a162ffd63ed52118e80c19.tar.bz2 mana-5afe88df2538274859a162ffd63ed52118e80c19.tar.xz mana-5afe88df2538274859a162ffd63ed52118e80c19.zip |
Apply C++11 fixits
modernize-use-auto
modernize-use-nullptr
modernize-use-override
modernize-use-using
Diffstat (limited to 'src/resources/attributes.cpp')
-rw-r--r-- | src/resources/attributes.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/resources/attributes.cpp b/src/resources/attributes.cpp index 58bff6f1..82871b2f 100644 --- a/src/resources/attributes.cpp +++ b/src/resources/attributes.cpp @@ -40,7 +40,7 @@ namespace Attributes { - typedef struct + using Attribute = struct { unsigned int id; std::string name; @@ -51,14 +51,14 @@ namespace Attributes { std::string scope; /** The playerInfo core Id the attribute is linked with or -1 if not */ int playerInfoId; - } Attribute; + }; /** Map for attributes. */ - typedef std::map<unsigned int, Attribute> AttributeMap; + using AttributeMap = std::map<unsigned int, Attribute>; static AttributeMap attributes; /** tags = effects on attributes. */ - typedef std::map< std::string, std::string > TagMap; + using TagMap = std::map<std::string, std::string>; static TagMap tags; /** List of modifiable attribute names used at character's creation. */ @@ -355,7 +355,7 @@ namespace Attributes { fillLabels(); // Sanity checks on starting points - float modifiableAttributeCount = (float) attributeLabels.size(); + auto modifiableAttributeCount = (float) attributeLabels.size(); float averageValue = ((float) creationPoints) / modifiableAttributeCount; if (averageValue > attributeMaximum || averageValue < attributeMinimum || creationPoints < 1) |