OregonCore  revision 3611e8a-git
Your Favourite TBC server
Object.h File Reference
#include "Common.h"
#include "Position.h"
#include "ByteBuffer.h"
#include "UpdateFields.h"
#include "UpdateData.h"
#include "GameSystem/GridReference.h"
#include "ObjectGuid.h"
#include "GridDefines.h"
#include "Map.h"
#include <set>
#include <string>

Go to the source code of this file.

Classes

class  Object
 
struct  MovementInfo
 
class  WorldLocation
 
class  GridObject< T >
 
class  FlaggedValuesArray32< T_VALUES, T_FLAGS, FLAG_TYPE, ARRAY_SIZE >
 
class  WorldObject
 
class  Oregon::ObjectDistanceOrderPred
 

Namespaces

 Movement
 
 Oregon
 

Macros

#define CONTACT_DISTANCE   0.5f
 
#define INTERACTION_DISTANCE   5.0f
 
#define ATTACK_DISTANCE   5.0f
 
#define INSPECT_DISTANCE   28.0f
 
#define MAX_VISIBILITY_DISTANCE   SIZE_OF_GRIDS
 
#define SIGHT_RANGE_UNIT   50.0f
 
#define DEFAULT_VISIBILITY_DISTANCE   90.0f
 
#define DEFAULT_VISIBILITY_INSTANCE   170.0f
 
#define DEFAULT_VISIBILITY_BGARENAS   533.0f
 
#define DEFAULT_WORLD_OBJECT_SIZE   0.388999998569489f
 
#define DEFAULT_COMBAT_REACH   1.5f
 
#define MIN_MELEE_REACH   2.0f
 
#define NOMINAL_MELEE_RANGE   5.0f
 
#define MELEE_RANGE   (NOMINAL_MELEE_RANGE - MIN_MELEE_REACH * 2)
 
#define GRID_SEARCH_ALL_ENTRIES   0
 
#define MAPID_INVALID   0xFFFFFFFF
 

Typedefs

typedef UNORDERED_MAP< Player *, UpdateDataUpdateDataMapType
 

Enumerations

enum  NotifyFlags { NOTIFY_NONE = 0x00, NOTIFY_AI_RELOCATION = 0x01, NOTIFY_VISIBILITY_CHANGED = 0x02, NOTIFY_ALL = 0xFF }
 
enum  MovementFlags {
  MOVEMENTFLAG_NONE = 0x00000000, MOVEMENTFLAG_FORWARD = 0x00000001, MOVEMENTFLAG_BACKWARD = 0x00000002, MOVEMENTFLAG_STRAFE_LEFT = 0x00000004,
  MOVEMENTFLAG_STRAFE_RIGHT = 0x00000008, MOVEMENTFLAG_TURN_LEFT = 0x00000010, MOVEMENTFLAG_TURN_RIGHT = 0x00000020, MOVEMENTFLAG_PITCH_UP = 0x00000040,
  MOVEMENTFLAG_PITCH_DOWN = 0x00000080, MOVEMENTFLAG_WALK_MODE = 0x00000100, MOVEMENTFLAG_ONTRANSPORT = 0x00000200, MOVEMENTFLAG_LEVITATING = 0x00000400,
  MOVEMENTFLAG_ROOT = 0x00000800, MOVEMENTFLAG_FALLING = 0x00001000, MOVEMENTFLAG_FALLINGFAR = 0x00004000, MOVEMENTFLAG_SWIMMING = 0x00200000,
  MOVEMENTFLAG_ASCENDING = 0x00400000, MOVEMENTFLAG_CAN_FLY = 0x00800000, MOVEMENTFLAG_FLYING = 0x01000000, MOVEMENTFLAG_FLYING2 = 0x02000000,
  MOVEMENTFLAG_SPLINE_ELEVATION = 0x04000000, MOVEMENTFLAG_SPLINE_ENABLED = 0x08000000, MOVEMENTFLAG_WATERWALKING = 0x10000000, MOVEMENTFLAG_SAFE_FALL = 0x20000000,
  MOVEMENTFLAG_HOVER = 0x40000000, MOVEMENTFLAG_MOVING, MOVEMENTFLAG_TURNING, MOVEMENTFLAG_MASK_MOVING_FLY
}
 

Functions

uint32 GuidHigh2TypeId (uint32 guid_hi)
 
ByteBufferoperator<< (ByteBuffer &buf, MovementInfo const &mi)
 
ByteBufferoperator>> (ByteBuffer &buf, MovementInfo &mi)
 

Macro Definition Documentation

#define ATTACK_DISTANCE   5.0f
#define DEFAULT_VISIBILITY_BGARENAS   533.0f

Definition at line 42 of file Object.h.

Referenced by World::LoadConfigSettings().

#define DEFAULT_VISIBILITY_DISTANCE   90.0f

Definition at line 40 of file Object.h.

Referenced by World::LoadConfigSettings(), ObjectMgr::LoadScripts(), and GameObject::Use().

#define DEFAULT_VISIBILITY_INSTANCE   170.0f
#define GRID_SEARCH_ALL_ENTRIES   0

Definition at line 50 of file Object.h.

Referenced by WorldObject::SummonCreature().

#define INSPECT_DISTANCE   28.0f
#define MELEE_RANGE   (NOMINAL_MELEE_RANGE - MIN_MELEE_REACH * 2)
#define MIN_MELEE_REACH   2.0f

Definition at line 46 of file Object.h.

Referenced by Unit::GetMeleeReach().

#define NOMINAL_MELEE_RANGE   5.0f

Definition at line 47 of file Object.h.

Referenced by Unit::GetVictim(), World::LoadConfigSettings(), and guardAI::UpdateAI().

#define SIGHT_RANGE_UNIT   50.0f

Definition at line 39 of file Object.h.

Referenced by WorldObject::GetSightRange().

Typedef Documentation

Definition at line 120 of file Object.h.

Enumeration Type Documentation

Enumerator
MOVEMENTFLAG_NONE 
MOVEMENTFLAG_FORWARD 
MOVEMENTFLAG_BACKWARD 
MOVEMENTFLAG_STRAFE_LEFT 
MOVEMENTFLAG_STRAFE_RIGHT 
MOVEMENTFLAG_TURN_LEFT 
MOVEMENTFLAG_TURN_RIGHT 
MOVEMENTFLAG_PITCH_UP 
MOVEMENTFLAG_PITCH_DOWN 
MOVEMENTFLAG_WALK_MODE 
MOVEMENTFLAG_ONTRANSPORT 
MOVEMENTFLAG_LEVITATING 
MOVEMENTFLAG_ROOT 
MOVEMENTFLAG_FALLING 
MOVEMENTFLAG_FALLINGFAR 
MOVEMENTFLAG_SWIMMING 
MOVEMENTFLAG_ASCENDING 
MOVEMENTFLAG_CAN_FLY 
MOVEMENTFLAG_FLYING 
MOVEMENTFLAG_FLYING2 
MOVEMENTFLAG_SPLINE_ELEVATION 
MOVEMENTFLAG_SPLINE_ENABLED 
MOVEMENTFLAG_WATERWALKING 
MOVEMENTFLAG_SAFE_FALL 
MOVEMENTFLAG_HOVER 
MOVEMENTFLAG_MOVING 
MOVEMENTFLAG_TURNING 
MOVEMENTFLAG_MASK_MOVING_FLY 

Definition at line 62 of file Object.h.

63 {
64  MOVEMENTFLAG_NONE = 0x00000000,
65  MOVEMENTFLAG_FORWARD = 0x00000001,
66  MOVEMENTFLAG_BACKWARD = 0x00000002,
67  MOVEMENTFLAG_STRAFE_LEFT = 0x00000004,
68  MOVEMENTFLAG_STRAFE_RIGHT = 0x00000008,
69  MOVEMENTFLAG_TURN_LEFT = 0x00000010,
70  MOVEMENTFLAG_TURN_RIGHT = 0x00000020,
71  MOVEMENTFLAG_PITCH_UP = 0x00000040,
72  MOVEMENTFLAG_PITCH_DOWN = 0x00000080,
73  MOVEMENTFLAG_WALK_MODE = 0x00000100, // Walking
74  MOVEMENTFLAG_ONTRANSPORT = 0x00000200, // Used for flying on some creatures
75  MOVEMENTFLAG_LEVITATING = 0x00000400,
76  MOVEMENTFLAG_ROOT = 0x00000800,
77  MOVEMENTFLAG_FALLING = 0x00001000,
78  MOVEMENTFLAG_FALLINGFAR = 0x00004000,
79  MOVEMENTFLAG_SWIMMING = 0x00200000, // appears with fly flag also
80  MOVEMENTFLAG_ASCENDING = 0x00400000, // swim up also
81  MOVEMENTFLAG_CAN_FLY = 0x00800000,
82  MOVEMENTFLAG_FLYING = 0x01000000,
83  MOVEMENTFLAG_FLYING2 = 0x02000000, // Actual flying mode
84  MOVEMENTFLAG_SPLINE_ELEVATION = 0x04000000, // used for flight paths
85  MOVEMENTFLAG_SPLINE_ENABLED = 0x08000000, // used for flight paths
86  MOVEMENTFLAG_WATERWALKING = 0x10000000, // prevent unit from falling through water
87  MOVEMENTFLAG_SAFE_FALL = 0x20000000, // Feather Fall (spell)
88  MOVEMENTFLAG_HOVER = 0x40000000,
89 
95 
98 
101 };
Enumerator
NOTIFY_NONE 
NOTIFY_AI_RELOCATION 
NOTIFY_VISIBILITY_CHANGED 
NOTIFY_ALL 

Definition at line 54 of file Object.h.

55 {
56  NOTIFY_NONE = 0x00,
57  NOTIFY_AI_RELOCATION = 0x01,
59  NOTIFY_ALL = 0xFF
60 };

Function Documentation

uint32 GuidHigh2TypeId ( uint32  guid_hi)

Definition at line 43 of file Object.cpp.

References HIGHGUID_CORPSE, HIGHGUID_DYNAMICOBJECT, HIGHGUID_GAMEOBJECT, HIGHGUID_ITEM, HIGHGUID_MO_TRANSPORT, HIGHGUID_PET, HIGHGUID_PLAYER, HIGHGUID_UNIT, TYPEID_CORPSE, TYPEID_DYNAMICOBJECT, TYPEID_GAMEOBJECT, TYPEID_ITEM, TYPEID_OBJECT, TYPEID_PLAYER, and TYPEID_UNIT.

Referenced by WorldSession::HandleBattlegroundHelloOpcode(), WorldSession::HandleBattlegroundJoinOpcode(), WorldSession::HandleInspectArenaStatsOpcode(), WorldSession::HandleInspectOpcode(), WorldSession::HandleQuestgiverStatusQueryOpcode(), and Aura::PeriodicTick().

44 {
45  switch (guid_hi)
46  {
47  case HIGHGUID_ITEM:
48  return TYPEID_ITEM;
49  //case HIGHGUID_CONTAINER: return TYPEID_CONTAINER; HIGHGUID_CONTAINER == HIGHGUID_ITEM currently
50  case HIGHGUID_UNIT:
51  return TYPEID_UNIT;
52  case HIGHGUID_PET:
53  return TYPEID_UNIT;
54  case HIGHGUID_PLAYER:
55  return TYPEID_PLAYER;
57  return TYPEID_GAMEOBJECT;
59  return TYPEID_DYNAMICOBJECT;
60  case HIGHGUID_CORPSE:
61  return TYPEID_CORPSE;
63  return TYPEID_GAMEOBJECT;
64  }
65  return TYPEID_OBJECT; // unknown
66 }
ByteBuffer& operator<< ( ByteBuffer buf,
MovementInfo const &  mi 
)
inline

Definition at line 553 of file Object.h.

References MovementInfo::Write().

554 {
555  mi.Write(buf);
556  return buf;
557 }
ByteBuffer& operator>> ( ByteBuffer buf,
MovementInfo mi 
)
inline

Definition at line 559 of file Object.h.

References MovementInfo::Read().

560 {
561  mi.Read(buf);
562  return buf;
563 }
void Read(ByteBuffer &data)
Definition: Unit.cpp:292