1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-19 22:23:51 +00:00

[Server] Add begin & end iterators to Cell class

This commit is contained in:
Koncord 2017-02-19 16:21:40 +08:00
parent bbc062de62
commit 846ceacc90
2 changed files with 14 additions and 1 deletions

View file

@ -19,7 +19,7 @@ void Cell::addPlayer(Player *player)
void Cell::removePlayer(Player *player) void Cell::removePlayer(Player *player)
{ {
for(Iterator it = players.begin(); it != players.end(); it++) for(Iterator it = begin(); it != end(); it++)
{ {
if(*it == player) if(*it == player)
{ {
@ -167,3 +167,13 @@ Cell::Cell(ESM::Cell cell): cell(cell)
{ {
} }
Cell::Iterator Cell::begin()
{
return players.begin();
}
Cell::Iterator Cell::end()
{
return players.end();
}

View file

@ -51,6 +51,9 @@ public:
typedef std::deque<Player*> TPlayers; typedef std::deque<Player*> TPlayers;
typedef TPlayers::iterator Iterator; typedef TPlayers::iterator Iterator;
Iterator begin();
Iterator end();
void addPlayer(Player *player); void addPlayer(Player *player);
void removePlayer(Player *player); void removePlayer(Player *player);