Changeset 257 for trunk/src/game/Map.h
- Timestamp:
- 11/19/08 13:51:33 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/game/Map.h
r206 r257 11 11 * This program is distributed in the hope that it will be useful, 12 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 14 * GNU General Public License for more details. 15 15 * 16 16 * You should have received a copy of the GNU General Public License 17 17 * along with this program; if not, write to the Free Software 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307USA18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 19 */ 20 20 … … 34 34 #include "SharedDefines.h" 35 35 #include "GameSystem/GridRefManager.h" 36 #include "MapRefManager.h" 36 37 37 38 #include <bitset> … … 127 128 class TRINITY_DLL_SPEC Map : public GridRefManager<NGridType>, public Trinity::ObjectLevelLockable<Map, ZThread::Mutex> 128 129 { 130 friend class MapReference; 129 131 public: 130 132 Map(uint32 id, time_t, uint32 InstanceId, uint8 SpawnMode); … … 238 240 GameObject* GetGameObjectInMap(uint64 guid); 239 241 242 bool HavePlayers() const { return !m_mapRefManager.isEmpty(); } 243 uint32 GetPlayersCountExceptGMs() const; 244 bool PlayersNearGrid(uint32 x,uint32 y) const; 245 246 void SendToPlayers(WorldPacket const* data) const; 247 248 typedef MapRefManager PlayerList; 249 PlayerList const& GetPlayers() const { return m_mapRefManager; } 240 250 template<class T> void SwitchGridContainers(T* obj, bool active); 241 251 private: … … 287 297 uint32 m_unloadTimer; 288 298 299 MapRefManager m_mapRefManager; 289 300 private: 290 301 typedef GridReadGuard ReadGuard; … … 326 337 { 327 338 public: 328 typedef std::list<Player *> PlayerList; // online players only329 330 339 InstanceMap(uint32 id, time_t, uint32 InstanceId, uint8 SpawnMode); 331 340 ~InstanceMap(); … … 338 347 InstanceData* GetInstanceData() { return i_data; } 339 348 void PermBindAllPlayers(Player *player); 340 PlayerList const& GetPlayers() const { return i_Players;}341 void SendToPlayers(WorldPacket const* data) const;342 349 time_t GetResetTime(); 343 350 void UnloadAll(bool pForce); 344 351 bool CanEnter(Player* player); 345 uint32 GetPlayersCountExceptGMs() const; 346 uint32 HavePlayers() const { return !i_Players.empty(); } 347 void SendResetWarnings(uint32 timeLeft); 352 void SendResetWarnings(uint32 timeLeft) const; 348 353 void SetResetSchedule(bool on); 349 354 private: … … 360 365 { 361 366 public: 362 typedef std::list<Player *> PlayerList; // online players only363 364 367 BattleGroundMap(uint32 id, time_t, uint32 InstanceId); 365 368 ~BattleGroundMap(); … … 370 373 void SetUnload(); 371 374 void UnloadAll(bool pForce); 372 private:373 PlayerList i_Players;374 375 }; 375 376