mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Entities: Move GridObject to its own header (#26358)
* GridObject * Add include to more files
This commit is contained in:
committed by
GitHub
parent
f8bd46cf8c
commit
43dd1b37d6
@@ -19,6 +19,7 @@
|
||||
#define TRINITYCORE_CORPSE_H
|
||||
|
||||
#include "Object.h"
|
||||
#include "GridObject.h"
|
||||
#include "DatabaseEnvFwd.h"
|
||||
#include "GridDefines.h"
|
||||
#include "Loot.h"
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include "DatabaseEnvFwd.h"
|
||||
#include "Duration.h"
|
||||
#include "Loot.h"
|
||||
#include "GridObject.h"
|
||||
#include "MapObject.h"
|
||||
#include <list>
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#define TRINITYCORE_DYNAMICOBJECT_H
|
||||
|
||||
#include "Object.h"
|
||||
#include "GridObject.h"
|
||||
#include "MapObject.h"
|
||||
|
||||
class Unit;
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#define TRINITYCORE_GAMEOBJECT_H
|
||||
|
||||
#include "Object.h"
|
||||
#include "GridObject.h"
|
||||
#include "DatabaseEnvFwd.h"
|
||||
#include "GameObjectData.h"
|
||||
#include "Loot.h"
|
||||
|
||||
20
src/server/game/Entities/Object/GridObject.h
Normal file
20
src/server/game/Entities/Object/GridObject.h
Normal file
@@ -0,0 +1,20 @@
|
||||
#ifndef _GRIDOBJECT_H
|
||||
#define _GRIDOBJECT_H
|
||||
|
||||
#include "GridReference.h"
|
||||
#include "GridRefManager.h"
|
||||
|
||||
template<class T>
|
||||
class GridObject
|
||||
{
|
||||
public:
|
||||
virtual ~GridObject() { }
|
||||
|
||||
bool IsInGrid() const { return _gridRef.isValid(); }
|
||||
void AddToGrid(GridRefManager<T>& m) { ASSERT(!IsInGrid()); _gridRef.link(&m, (T*)this); }
|
||||
void RemoveFromGrid() { ASSERT(IsInGrid()); _gridRef.unlink(); }
|
||||
private:
|
||||
GridReference<T> _gridRef;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -21,8 +21,6 @@
|
||||
#include "Common.h"
|
||||
#include "Duration.h"
|
||||
#include "EventProcessor.h"
|
||||
#include "GridReference.h"
|
||||
#include "GridRefManager.h"
|
||||
#include "ModelIgnoreFlags.h"
|
||||
#include "MovementInfo.h"
|
||||
#include "ObjectDefines.h"
|
||||
@@ -244,19 +242,6 @@ class TC_GAME_API Object
|
||||
Object& operator=(Object const& right) = delete;
|
||||
};
|
||||
|
||||
template<class T>
|
||||
class GridObject
|
||||
{
|
||||
public:
|
||||
virtual ~GridObject() { }
|
||||
|
||||
bool IsInGrid() const { return _gridRef.isValid(); }
|
||||
void AddToGrid(GridRefManager<T>& m) { ASSERT(!IsInGrid()); _gridRef.link(&m, (T*)this); }
|
||||
void RemoveFromGrid() { ASSERT(IsInGrid()); _gridRef.unlink(); }
|
||||
private:
|
||||
GridReference<T> _gridRef;
|
||||
};
|
||||
|
||||
template <class T_VALUES, class T_FLAGS, class FLAG_TYPE, uint8 ARRAY_SIZE>
|
||||
class FlaggedValuesArray32
|
||||
{
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
|
||||
#include "UpdateFields.h"
|
||||
#include "ByteBuffer.h"
|
||||
#include "Errors.h"
|
||||
|
||||
class UpdateMask
|
||||
{
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#ifndef _PLAYER_H
|
||||
#define _PLAYER_H
|
||||
|
||||
#include "GridObject.h"
|
||||
#include "Unit.h"
|
||||
#include "DatabaseEnvFwd.h"
|
||||
#include "DBCEnums.h"
|
||||
|
||||
Reference in New Issue
Block a user