Core/Objects: added ToUnit(), ToGameObject() (will be used in future)

Core/Unit:
- added SetFacing() function, using proper packet implementetion (spline type)
- added GetAuraCount() function (will be used in future)
Core/Creature: renamed one unknown type_flag

--HG--
branch : trunk
This commit is contained in:
Rat
2010-10-17 21:14:08 +02:00
parent 1e101ed785
commit ee32b4b39a
6 changed files with 49 additions and 3 deletions

View File

@@ -323,6 +323,10 @@ class Object
Creature* ToCreature(){ if (GetTypeId() == TYPEID_UNIT) return reinterpret_cast<Creature*>(this); else return NULL; }
const Creature* ToCreature() const {if (GetTypeId() == TYPEID_UNIT) return (const Creature*)((Creature*)this); else return NULL; }
Unit* ToUnit(){ if (GetTypeId() == TYPEID_UNIT || GetTypeId() == TYPEID_PLAYER) return reinterpret_cast<Unit*>(this); else return NULL; }
const Unit* ToUnit() const {if (GetTypeId() == TYPEID_UNIT || GetTypeId() == TYPEID_PLAYER) return (const Unit*)((Unit*)this); else return NULL; }
GameObject* ToGameObject(){ if (GetTypeId() == TYPEID_GAMEOBJECT) return reinterpret_cast<GameObject*>(this); else return NULL; }
const GameObject* ToGameObject() const {if (GetTypeId() == TYPEID_GAMEOBJECT) return (const GameObject*)((GameObject*)this); else return NULL; }
protected:
Object ();