40 for (
unsigned int i = 0; i < strategies.size(); i++)
41 if (strategies[i]->mShortName == name)
63 : DEFAULT_IGNORE_STRATEGY;
72 listener->playerRelationsUpdated();
76 const std::string &playerName,
107 return permissions & flags;
120 unsigned int rejections = flags & ~checkPermissionSilently(name, flags);
121 bool permitted = rejections == 0;
142 std::vector<std::string> retval;
145 retval.push_back(name);
147 sort(retval.begin(), retval.end());
233std::vector<PlayerIgnoreStrategy *> &
ActorSpriteManager * actorSpriteManager
Being * findBeingByName(const std::string &name, ActorSprite::Type type=Being::UNKNOWN) const
Finds a being by name and (optionally) by type.
Type getType() const final
Returns the type of the ActorSprite.
const std::string & getName() const
Returns the name of the being.
void setSpeech(const std::string &text, int time=5000)
Puts a "speech balloon" above this being for the specified amount of time.
void ignore(Being *being, unsigned int flags) override
Handle the ignoring of the indicated action by the indicated player.
void ignore(Being *being, unsigned int flags) override
Handle the ignoring of the indicated action by the indicated player.
void ignore(Being *being, unsigned int flags) override
Handle the ignoring of the indicated action by the indicated player.
Ignore strategy: describes how we should handle ignores.
virtual void ignore(Being *being, unsigned int flags)=0
Handle the ignoring of the indicated action by the indicated player.
Player relations class, represents any particular relations and/or preferences the user of the local ...
void store()
Save configuration to our config file.
std::vector< PlayerIgnoreStrategy * > mIgnoreStrategies
PlayerIgnoreStrategy * mIgnoreStrategy
void init()
Initialise player relations manager (load config file etc.)
std::vector< std::string > getPlayers() const
Retrieves a sorted vector of all players for which we have any relations recorded.
PlayerRelation getRelation(const std::string &name) const
Updates the relationship with this player.
std::map< std::string, PlayerRelation > mRelations
unsigned int getDefault() const
Retrieves the default permissions.
bool hasPermission(Being *being, unsigned int flags)
Tests whether the player in question is being ignored for any of the actions in the specified flags.
~PlayerRelationsManager()
std::vector< PlayerIgnoreStrategy * > & getPlayerIgnoreStrategies()
Retrieves all known player ignore strategies.
void setDefault(unsigned int permissions)
Sets the default permissions.
int getPlayerIgnoreStrategyIndex(const std::string &shortName)
For a given ignore strategy short name, find the appropriate index in the ignore strategies vector.
void setPlayerIgnoreStrategy(PlayerIgnoreStrategy *strategy)
Sets the strategy to call when ignoring players.
void setRelation(const std::string &name, PlayerRelation relation)
Updates the relationship with this player.
void removePlayer(const std::string &name)
Deletes the information recorded for a player.
unsigned int checkPermissionSilently(const std::string &player_name, unsigned int flags)
Determines whether the player in question is being ignored, filtered by the specified flags.
std::list< PlayerRelationsListener * > mListeners
Config config
Global settings (config.xml)
void delete_all(Container &c)
PlayerRelationsManager player_relations
bool persistentPlayerList
std::map< std::string, PlayerRelation > players
std::string playerIgnoreStrategy
unsigned defaultPlayerPermissions