forked from teamnwah/openmw-tes3coop
[Server] Add begin & end iterators to Cell class
This commit is contained in:
parent
bbc062de62
commit
846ceacc90
2 changed files with 14 additions and 1 deletions
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -51,6 +51,9 @@ public:
|
|||
typedef std::deque<Player*> TPlayers;
|
||||
typedef TPlayers::iterator Iterator;
|
||||
|
||||
Iterator begin();
|
||||
Iterator end();
|
||||
|
||||
void addPlayer(Player *player);
|
||||
void removePlayer(Player *player);
|
||||
|
||||
|
|
Loading…
Reference in a new issue