summaryrefslogtreecommitdiffstats
path: root/source/Entity.h
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-12-21 13:52:14 +0100
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-12-21 13:52:14 +0100
commitafaf104b4086dbc5245f92a209cb68a088780ebb (patch)
tree82bdb4f173cda642566206066f8fdd27b9f725b5 /source/Entity.h
parentAdded "Latest version" to the PrimaryServerVersion in webadmin settings (patch contributed by STR_Warrior) (diff)
downloadcuberite-afaf104b4086dbc5245f92a209cb68a088780ebb.tar
cuberite-afaf104b4086dbc5245f92a209cb68a088780ebb.tar.gz
cuberite-afaf104b4086dbc5245f92a209cb68a088780ebb.tar.bz2
cuberite-afaf104b4086dbc5245f92a209cb68a088780ebb.tar.lz
cuberite-afaf104b4086dbc5245f92a209cb68a088780ebb.tar.xz
cuberite-afaf104b4086dbc5245f92a209cb68a088780ebb.tar.zst
cuberite-afaf104b4086dbc5245f92a209cb68a088780ebb.zip
Diffstat (limited to 'source/Entity.h')
-rw-r--r--source/Entity.h30
1 files changed, 21 insertions, 9 deletions
diff --git a/source/Entity.h b/source/Entity.h
index 7cb168581..132679db2 100644
--- a/source/Entity.h
+++ b/source/Entity.h
@@ -77,19 +77,31 @@ public:
ENTITY_STATUS_SHEEP_EATING = 10,
} ;
- cEntity(double a_X, double a_Y, double a_Z);
+ enum eEntityType
+ {
+ etEntity, // For all other types
+ etPlayer,
+ etPickup,
+ etMob,
+ etFallingBlock,
+
+ // Older constants, left over for compatibility reasons (plugins)
+ eEntityType_Entity = etEntity,
+ eEntityType_Player = etPlayer,
+ eEntityType_Pickup = etPickup,
+ eEntityType_Mob = etMob,
+ } ;
+
+ cEntity(eEntityType a_EntityType, double a_X, double a_Y, double a_Z);
virtual ~cEntity();
virtual void Initialize(cWorld * a_World);
- enum eEntityType
- {
- eEntityType_Entity,
- eEntityType_Player,
- eEntityType_Pickup
- };
-
- virtual unsigned int GetEntityType(void) const { return m_EntityType; }
+ eEntityType GetEntityType(void) const { return m_EntityType; }
+
+ bool IsPlayer(void) const { return (m_EntityType == etPlayer); }
+ bool IsPickup(void) const { return (m_EntityType == etPickup); }
+ bool IsMob (void) const { return (m_EntityType == etMob); }
/// Returns true if the entity is of the specified class or a subclass (cPawn's IsA("cEntity") returns true)
virtual bool IsA(const char * a_ClassName) const;