Changeset 279 for trunk/src/game/Map.h
- Timestamp:
- 11/22/08 00:36:22 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/game/Map.h
r272 r279 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> … … 105 106 float startLocZ; 106 107 float startLocO; 107 char const* script;108 uint32 script_id; 108 109 }; 109 110 … … 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(); … … 335 344 void CreateInstanceData(bool load); 336 345 bool Reset(uint8 method); 337 std::string GetScript() { return i_script; }346 uint32 GetScriptId() { return i_script_id; } 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: … … 351 356 bool m_unloadWhenEmpty; 352 357 InstanceData* i_data; 353 std::string i_script; 354 // only online players that are inside the instance currently 355 // TODO ? - use the grid instead to access the players 356 PlayerList i_Players; 358 uint32 i_script_id; 357 359 }; 358 360 … … 360 362 { 361 363 public: 362 typedef std::list<Player *> PlayerList; // online players only363 364 364 BattleGroundMap(uint32 id, time_t, uint32 InstanceId); 365 365 ~BattleGroundMap(); … … 370 370 void SetUnload(); 371 371 void UnloadAll(bool pForce); 372 private:373 PlayerList i_Players;374 372 }; 375 373