Working on reimplementing the player characters

I've also added EraseIf() to the manager classes.
This commit is contained in:
Kayne Ruse
2014-03-07 22:09:50 +11:00
parent 006a72174f
commit 56d02ad8d4
6 changed files with 56 additions and 25 deletions
+4 -4
View File
@@ -40,9 +40,8 @@ struct PlayerEntry {
class PlayerManager {
public:
//clarity typedefs
typedef std::map<int, PlayerEntry> Container;
typedef Container::iterator Iterator;
typedef std::function<void(Iterator)> Lambda;
typedef std::map<int, PlayerEntry> Container;
typedef Container::iterator Iterator;
//These functions interact with the database
//*Deletion, *Load and *Unload returns: 0 success, -1 failure
@@ -54,7 +53,8 @@ public:
int HandlePlayerUnload (int uniqueID);
//lambdas
void ForEach(Lambda);
void ForEach(std::function<void(Iterator)> fn);
void EraseIf(std::function<bool(Iterator)> fn);
//accessors
PlayerEntry* GetPlayer(int uniqueID);