summaryrefslogtreecommitdiff
path: root/src/game-server/attributemanager.h
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2011-03-19 12:30:19 +0100
committerThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2011-03-20 15:09:09 +0100
commitfbcc334baf71ca8735adb66c837f6bb610cba758 (patch)
treeefc041388a48a7908e79677540df97c99a9b2eeb /src/game-server/attributemanager.h
parent5b3c4a585b211b03fb2999cddd2558e030ed5c0e (diff)
downloadmanaserv-fbcc334baf71ca8735adb66c837f6bb610cba758.tar.gz
manaserv-fbcc334baf71ca8735adb66c837f6bb610cba758.tar.bz2
manaserv-fbcc334baf71ca8735adb66c837f6bb610cba758.tar.xz
manaserv-fbcc334baf71ca8735adb66c837f6bb610cba758.zip
Renaming stuff to make the code more readable
SCOPE_TYPES -> ScopeType (plural was confusing) ATTR_BEING -> BeingScope ATTR_CHAR -> CharacterScope ATTR_MOD -> MonsterScope ATTR_MAX -> MaxScope AttributeScopes -> AttributeScope (A single scope seems to include multiple lists of attributes. Seems wrong to me to name this type in plural form.) getAttributeInfoForType -> getAttributeScope (just naming it after what it is actually returning) Reviewed-by: Freeyorp
Diffstat (limited to 'src/game-server/attributemanager.h')
-rw-r--r--src/game-server/attributemanager.h26
1 files changed, 15 insertions, 11 deletions
diff --git a/src/game-server/attributemanager.h b/src/game-server/attributemanager.h
index a87ba901..7e05c914 100644
--- a/src/game-server/attributemanager.h
+++ b/src/game-server/attributemanager.h
@@ -25,22 +25,24 @@
#include <vector>
#include <string>
-typedef struct AttributeInfoType AttributeInfoType_t;
-
-enum SCOPE_TYPES {
- ATTR_BEING = 0,
- ATTR_CHAR,
- ATTR_MOB,
+enum ScopeType
+{
+ BeingScope = 0,
+ CharacterScope,
+ MonsterScope,
// Add new types here as needed
- ATTR_MAX
+ MaxScope
};
-typedef std::map< int, std::vector<struct AttributeInfoType> * > AttributeScopes;
+typedef std::map< int, std::vector<struct AttributeInfoType> * > AttributeScope;
class AttributeManager
{
public:
- AttributeManager(const std::string &file) : mAttributeReferenceFile(file) {}
+ AttributeManager(const std::string &file) :
+ mAttributeReferenceFile(file)
+ {}
+
/**
* Loads attribute reference file.
*/
@@ -50,15 +52,17 @@ class AttributeManager
* Reloads attribute reference file.
*/
void reload();
+
const std::vector<struct AttributeInfoType> *getAttributeInfo(unsigned int) const;
- const AttributeScopes &getAttributeInfoForType(SCOPE_TYPES) const;
+ const AttributeScope &getAttributeScope(ScopeType) const;
bool isAttributeDirectlyModifiable(unsigned int) const;
std::pair<unsigned int,unsigned int> getInfoFromTag(const std::string &) const;
const std::string *getTagFromInfo(unsigned int, unsigned int) const;
+
private:
// modifiable, { stackable type, effect type }[]
typedef std::pair< bool,
@@ -71,7 +75,7 @@ class AttributeManager
std::pair<unsigned int, unsigned int> > TagMap;
// being type id -> (*{ stackable type, effect type })[]
- AttributeScopes mAttributeScopes[ATTR_MAX];
+ AttributeScope mAttributeScopes[MaxScope];
AttributeMap mAttributeMap;
TagMap mTagMap;