Planeshift
gemItem Class Reference

#include <gem.h>

Public Member Functions

virtual void Broadcast (int clientnum, bool control)
 
void ClearItemData ()
 
 gemItem (GEMSupervisor *gemsupervisor, CacheManager *cachemanager, EntityManager *entitymanager, psItem *item, const char *factname, InstanceID myInstance, iSector *room, const csVector3 &pos, float xrotangle, float yrotangle, float zrotangle, int clientnum)
 
virtual float GetBaseAdvertiseRange ()
 This value indicates the range that this entity would become visible to other entities if no other modifiers were taken into consideration. More...
 
virtual bool GetCanTransform ()
 
psItemGetItemData ()
 
virtual const char * GetObjectType ()
 
virtual void GetRotation (float &xrotangle, float &yrotangle, float &zrotangle)
 Get the x,y and z axis rotations for the item. More...
 
uint32_t GetTribeID ()
 
virtual bool GetVisibility ()
 
virtual bool IsConstructible ()
 
virtual bool IsContainer ()
 
virtual bool IsLockable ()
 
virtual bool IsLocked ()
 
virtual bool IsPickupable ()
 Gets if the object can be picked up from anyone. More...
 
virtual bool IsPickupableStrong ()
 Gets if the object can be picked up from anyone according to strong rules. More...
 
virtual bool IsPickupableWeak ()
 Gets if the object can be picked up from anyone according to weak rules. More...
 
virtual bool IsSecurityLocked ()
 
virtual bool IsUsingCD ()
 
virtual bool Send (int clientnum, bool control, bool to_superclients, psPersistAllEntities *allEntities=NULL)
 Send this object to the given client. More...
 
virtual void SendBehaviorMessage (const csString &str, gemObject *obj)
 
virtual void SetPosition (const csVector3 &pos, float angle, iSector *sector, InstanceID instance)
 Set position of item in world. More...
 
virtual void SetRotation (float xrotangle, float yrotangle, float zrotangle)
 Set the x, y and z axis rotations for the item. More...
 
void SetTribeID (uint32_t id)
 
virtual ~gemItem ()
 
iScriptableVar implementation

Functions that implement the iScriptableVar interface.

virtual double GetProperty (MathEnvironment *env, const char *ptr)
 
virtual double CalcFunction (MathEnvironment *env, const char *functionName, const double *params)
 
- Public Member Functions inherited from gemActiveObject
 gemActiveObject (GEMSupervisor *gemSupervisor, EntityManager *entitymanager, CacheManager *cachemanager, const char *name, const char *factname, InstanceID myInstance, iSector *room, const csVector3 &pos, float rotangle, int clientnum)
 
virtual csString GetDefaultBehavior (const csString &dfltBehaviors)
 
virtual bool IsSecutityLocked ()
 
- Public Member Functions inherited from gemObject
virtual void Disconnect ()
 Called when a client disconnects. More...
 
virtual void Dump ()
 Dump debug information. More...
 
gemActorGetActorPtr ()
 
gemActionLocationGetALPtr ()
 
virtual psCharacterGetCharacterData ()
 
virtual ClientGetClient () const
 
uint32_t GetClientID ()
 
EID GetEID ()
 
InstanceID GetInstance ()
 
psItemGetItem ()
 
gemItemGetItemPtr ()
 
const char * GetName ()
 
gemNPCGetNPCPtr ()
 
gemPetGetPetPtr ()
 
bool IsAlive () const
 Returns whether the object is alive. More...
 
virtual bool IsUpdateReq (csVector3 const &pos, csVector3 const &oldPos)
 
virtual bool IsValid (void)
 
float RangeTo (gemObject *obj, bool ignoreY=false, bool ignoreInstance=false)
 
void RegisterCallback (iDeleteObjectCallback *receiver)
 
void SetAlive (bool flag, bool queue=true)
 Set needed stats for alive or dead for object. More...
 
void SetInstance (InstanceID newInstance)
 
void SetName (const char *n)
 
void UnregisterCallback (iDeleteObjectCallback *receiver)
 
virtual ~gemObject ()
 
virtual const char * ToString ()
 
iMeshWrapper * GetMeshWrapper ()
 
csString GetMesh ()
 
void Move (const csVector3 &pos, float rotangle, iSector *room)
 
bool IsNear (gemObject *obj, float radius, bool ignoreY=false)
 
const csVector3 & GetPosition ()
 
void GetPosition (csVector3 &pos, float &yrot, iSector *&sector)
 
void GetPosition (csVector3 &pos, iSector *&sector)
 
float GetAngle ()
 Get rotation of entity as returned by psWorld::Matrix2YRot. More...
 
iSector * GetSector ()
 
virtual float GetVelocity ()
 Get the z velocity of the actor. More...
 
const char * GetSectorName ()
 
csArray< gemObject * > * GetObjectsInRange (float range)
 
ProximityListGetProxList ()
 
csArray< PublishDestination > & GetMulticastClients ()
 Returns all the clients which are inside our proxy list. More...
 
void UpdateProxList (bool force=false)
 Generates proxlist if needed (or forced). More...
 
void RemoveFromAllProx ()
 
void SetAlwaysWatching (bool w)
 
bool AlwaysWatching ()
 
virtual void SendGroupMessage (MsgEntry *me)
 Distribute this object to all members of a group. More...
 
virtual PID GetPID ()
 
virtual int GetGuildID ()
 
virtual psGuildInfoGetGuild ()
 
virtual bool UpdateDR ()
 
virtual void BroadcastTargetStatDR (ClientConnectionSet *clients)
 
virtual void SendTargetStatDR (Client *client)
 
virtual psNPCDialogGetNPCDialogPtr ()
 
virtual void GetLastSuperclientPos (csVector3 &pos, InstanceID &instance, csTicks &last) const
 
virtual void SetLastSuperclientPos (const csVector3 &pos, InstanceID instance, const csTicks &now)
 
virtual void AddLootablePlayer (PID playerID)
 
virtual void RemoveLootablePlayer (PID playerID)
 
virtual bool IsLootablePlayer (PID playerID)
 
virtual ClientGetRandomLootClient (int range)
 
virtual AccountID GetSuperclientID ()
 
virtual void SetSuperclientID (AccountID id)
 
virtual bool SeesObject (gemObject *object, float range)
 
virtual gemObjectGetOwner ()
 
virtual bool HasKillStealProtection ()
 Returns if the object has killsteal protection. More...
 
- Public Member Functions inherited from iDeleteNotificationObject
virtual ~iDeleteNotificationObject ()
 
- Public Member Functions inherited from iScriptableVar
virtual ~iScriptableVar ()
 

Protected Attributes

psItemitemdata
 
csString itemType
 
uint32_t tribeID
 Holds the id of the tribe owning this item (0 if is not tribe-owned) More...
 
float xRot
 
float yRot
 
float zRot
 
- Protected Attributes inherited from gemObject
bool alwaysWatching
 True if this object always watches (proxlists) regardless of owner. More...
 
CacheManagercacheManager
 
EID eid
 Entity ID (unique identifier for object) More...
 
EntityManagerentityManager
 
csString factname
 Name of CS Mesh Factory used to create this object. More...
 
bool is_alive
 Flag indicating whether object is alive or not. More...
 
csString matname
 Name of base material used by this object. More...
 
csString name
 Name of this object, used mostly for debugging. More...
 
csRef< iMeshFactoryWrapper > nullfact
 Null factory for our mesh instances. More...
 
gemMeshpcmesh
 link to mesh class More...
 
float prox_distance_current
 What is the current actual range for proxlists (they adjust when the # of objects gets too high) More...
 
float prox_distance_desired
 What is the maximum range of proxlist we want. More...
 
ProximityListproxlist
 Proximity List for this object. More...
 
csArray< iDeleteObjectCallback * > receivers
 List of objects which are to be notified when this object is deleted. More...
 
bool valid
 Is object fully loaded. More...
 
InstanceID worldInstance
 Only objects which match instances can see each other. More...
 

Additional Inherited Members

- Protected Member Functions inherited from gemObject
 gemObject (GEMSupervisor *gemsupervisor, EntityManager *entitymanager, CacheManager *cachemanager, const char *name, const char *factname, InstanceID myinstance, iSector *room, const csVector3 &pos, float rotangle, int clientnum)
 
void InitMesh (const char *name, const csVector3 &pos, const float rotangle, iSector *room)
 
bool InitProximityList (float radius, int clientnum)
 
- Static Protected Attributes inherited from gemObject
static GEMSupervisorcel
 Static ptr back to main collection of all objects. More...
 

Detailed Description

Definition at line 768 of file gem.h.

Constructor & Destructor Documentation

gemItem::gemItem ( GEMSupervisor gemsupervisor,
CacheManager cachemanager,
EntityManager entitymanager,
psItem item,
const char *  factname,
InstanceID  myInstance,
iSector *  room,
const csVector3 &  pos,
float  xrotangle,
float  yrotangle,
float  zrotangle,
int  clientnum 
)
virtual gemItem::~gemItem ( )
inlinevirtual

Definition at line 792 of file gem.h.

Member Function Documentation

virtual void gemItem::Broadcast ( int  clientnum,
bool  control 
)
virtual
Parameters
clientnumThe client that initiated this update.
controlSet to true when sent to the controlling client.

Reimplemented from gemActiveObject.

virtual double gemItem::CalcFunction ( MathEnvironment env,
const char *  functionName,
const double *  params 
)
virtual

Reimplemented from gemObject.

void gemItem::ClearItemData ( )
inline

Definition at line 814 of file gem.h.

virtual float gemItem::GetBaseAdvertiseRange ( )
virtual

This value indicates the range that this entity would become visible to other entities if no other modifiers were taken into consideration.

Reimplemented from gemObject.

virtual bool gemItem::GetCanTransform ( )
virtual
psItem* gemItem::GetItemData ( )
inline

Definition at line 810 of file gem.h.

virtual const char* gemItem::GetObjectType ( )
inlinevirtual

Reimplemented from gemActiveObject.

Definition at line 806 of file gem.h.

virtual double gemItem::GetProperty ( MathEnvironment env,
const char *  ptr 
)
virtual

Reimplemented from gemObject.

virtual void gemItem::GetRotation ( float xrotangle,
float yrotangle,
float zrotangle 
)
virtual

Get the x,y and z axis rotations for the item.

Parameters
xrotanglethe variable in which the x rotation will be stored
yrotanglethe variable in which the y rotation will be stored
zrotanglethe variable in which the z rotation will be stored
uint32_t gemItem::GetTribeID ( )
inline

Definition at line 801 of file gem.h.

virtual bool gemItem::GetVisibility ( )
virtual

Reimplemented from gemObject.

virtual bool gemItem::IsConstructible ( )
virtual

Reimplemented from gemActiveObject.

virtual bool gemItem::IsContainer ( )
virtual

Reimplemented from gemActiveObject.

virtual bool gemItem::IsLockable ( )
virtual

Reimplemented from gemActiveObject.

virtual bool gemItem::IsLocked ( )
virtual

Reimplemented from gemActiveObject.

virtual bool gemItem::IsPickupable ( )
virtual

Gets if the object can be picked up from anyone.

Returns
TRUE if the object can be picked up from anyone.

Reimplemented from gemActiveObject.

virtual bool gemItem::IsPickupableStrong ( )
virtual

Gets if the object can be picked up from anyone according to strong rules.

This is a stronger version.

Returns
TRUE if the object can be picked up from anyone according to strong rules.

Reimplemented from gemActiveObject.

virtual bool gemItem::IsPickupableWeak ( )
virtual

Gets if the object can be picked up from anyone according to weak rules.

This is a weaker version which allows more overriding of the not pickupable status.

Returns
TRUE if the object can be picked up from anyone according to weak rules.

Reimplemented from gemActiveObject.

virtual bool gemItem::IsSecurityLocked ( )
virtual
virtual bool gemItem::IsUsingCD ( )
virtual
virtual bool gemItem::Send ( int  clientnum,
bool  control,
bool  to_superclients,
psPersistAllEntities allEntities = NULL 
)
virtual

Send this object to the given client.

Parameters
clientnumThe client that initiated this update.
controlSet to true when sent to the controlling client.
to_superclientsSend to super clients
allEntitiesBuffer the message instead of sending it.

Reimplemented from gemActiveObject.

virtual void gemItem::SendBehaviorMessage ( const csString &  str,
gemObject obj 
)
virtual

Reimplemented from gemActiveObject.

virtual void gemItem::SetPosition ( const csVector3 &  pos,
float  angle,
iSector *  sector,
InstanceID  instance 
)
virtual

Set position of item in world.

Parameters
posThe coordinates of the object in the sector
angleThe y rotation angle
sectorThe sector in which the object is
instanceThe instance the object is in
Returns
Set the position of the item in given sector, instance and position. Also sets the item y rotation
virtual void gemItem::SetRotation ( float  xrotangle,
float  yrotangle,
float  zrotangle 
)
virtual

Set the x, y and z axis rotations for the item.

Parameters
xrotanglethe variable used to set the x rotation of the item
yrotanglethe variable used to set the x rotation of the item
zrotanglethe variable used to set the z rotation of the item
void gemItem::SetTribeID ( uint32_t  id)
inline

Definition at line 797 of file gem.h.

Member Data Documentation

psItem* gemItem::itemdata
protected

Definition at line 771 of file gem.h.

csString gemItem::itemType
protected

Definition at line 772 of file gem.h.

uint32_t gemItem::tribeID
protected

Holds the id of the tribe owning this item (0 if is not tribe-owned)

Definition at line 776 of file gem.h.

float gemItem::xRot
protected

Definition at line 773 of file gem.h.

float gemItem::yRot
protected

Definition at line 774 of file gem.h.

float gemItem::zRot
protected

Definition at line 775 of file gem.h.


The documentation for this class was generated from the following file: