summaryrefslogtreecommitdiff
path: root/src/playerrelations.h
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-03-24 00:02:50 +0300
committerAndrei Karas <akaras@inbox.ru>2013-03-24 00:02:50 +0300
commit944aaba6adf16becb8c82efd35df25f8c90e25b5 (patch)
treedd3026bb8683d7e626e7bc9c93d14b3df47229de /src/playerrelations.h
parent0e9c8d981843947d2210bf3782ddacf01ae8fff9 (diff)
downloadmv-944aaba6adf16becb8c82efd35df25f8c90e25b5.tar.gz
mv-944aaba6adf16becb8c82efd35df25f8c90e25b5.tar.bz2
mv-944aaba6adf16becb8c82efd35df25f8c90e25b5.tar.xz
mv-944aaba6adf16becb8c82efd35df25f8c90e25b5.zip
Improve playerrelation class.
Diffstat (limited to 'src/playerrelations.h')
-rw-r--r--src/playerrelations.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/playerrelations.h b/src/playerrelations.h
index d301a3f3b..fb185ce60 100644
--- a/src/playerrelations.h
+++ b/src/playerrelations.h
@@ -129,7 +129,7 @@ class PlayerRelationsManager final
/**
* Save configuration to our config file.
*/
- void store();
+ void store() const;
/**
* Determines whether the player in question is being ignored, filtered by
@@ -137,7 +137,7 @@ class PlayerRelationsManager final
*/
unsigned int checkPermissionSilently(const std::string &player_name,
const unsigned int flags)
- A_WARN_UNUSED;
+ const A_WARN_UNUSED;
/**
* Tests whether the player in question is being ignored for any of the
@@ -145,10 +145,10 @@ class PlayerRelationsManager final
* if requested by the player.
*/
bool hasPermission(const Being *const being,
- const unsigned int flags) A_WARN_UNUSED;
+ const unsigned int flags) const A_WARN_UNUSED;
bool hasPermission(const std::string &being,
- const unsigned int flags) A_WARN_UNUSED;
+ const unsigned int flags) const A_WARN_UNUSED;
/**
* Updates the relationship with this player.
@@ -160,7 +160,7 @@ class PlayerRelationsManager final
* Updates the relationship with this player.
*/
PlayerRelation::Relation getRelation(const std::string &name)
- A_WARN_UNUSED;
+ const A_WARN_UNUSED;
/**
* Deletes the information recorded for a player.
@@ -214,10 +214,10 @@ class PlayerRelationsManager final
* Retrieves a sorted vector of all players for which we have any
* relations recorded.
*/
- StringVect *getPlayers() A_WARN_UNUSED;
+ StringVect *getPlayers() const A_WARN_UNUSED;
StringVect *getPlayersByRelation(const PlayerRelation::Relation rel)
- A_WARN_UNUSED;
+ const A_WARN_UNUSED;
/**
* Removes all recorded player info.
@@ -230,11 +230,11 @@ class PlayerRelationsManager final
bool getPersistIgnores() const
{ return mPersistIgnores; }
- void ignoreTrade(std::string name);
+ void ignoreTrade(const std::string &name);
- bool isGoodName(Being *const being) A_WARN_UNUSED;
+ bool isGoodName(Being *const being) const A_WARN_UNUSED;
- bool isGoodName(std::string name) A_WARN_UNUSED;
+ bool isGoodName(const std::string &name) const A_WARN_UNUSED;
/**
* Change the `ignore persist' flag.
@@ -250,7 +250,7 @@ class PlayerRelationsManager final
void removeListener(PlayerRelationsListener *const listener)
{ mListeners.remove(listener); }
- bool checkBadRelation(std::string name) A_WARN_UNUSED;
+ bool checkBadRelation(const std::string &name) const A_WARN_UNUSED;
private:
void signalUpdate(const std::string &name);