From 846ceacc9002da0a92c4a909174046a97b7ee4a2 Mon Sep 17 00:00:00 2001 From: Koncord Date: Sun, 19 Feb 2017 16:21:40 +0800 Subject: [PATCH] [Server] Add begin & end iterators to Cell class --- apps/openmw-mp/Cell.cpp | 12 +++++++++++- apps/openmw-mp/Cell.hpp | 3 +++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/apps/openmw-mp/Cell.cpp b/apps/openmw-mp/Cell.cpp index bcba54298..642c40e35 100644 --- a/apps/openmw-mp/Cell.cpp +++ b/apps/openmw-mp/Cell.cpp @@ -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(); +} diff --git a/apps/openmw-mp/Cell.hpp b/apps/openmw-mp/Cell.hpp index a38d42228..54ff89e22 100644 --- a/apps/openmw-mp/Cell.hpp +++ b/apps/openmw-mp/Cell.hpp @@ -50,6 +50,9 @@ public: Cell(ESM::Cell cell); typedef std::deque TPlayers; typedef TPlayers::iterator Iterator; + + Iterator begin(); + Iterator end(); void addPlayer(Player *player); void removePlayer(Player *player);