[Server] Add begin & end iterators to Cell class

pull/158/head
Koncord 8 years ago
parent bbc062de62
commit 846ceacc90

@ -19,7 +19,7 @@ void Cell::addPlayer(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)
{
@ -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();
}

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

Loading…
Cancel
Save