diff options
author | faketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-02-03 00:55:29 +0100 |
---|---|---|
committer | faketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-02-03 00:55:29 +0100 |
commit | fdcad8a72d6f66d62dcd5893f9ba7bf421043a61 (patch) | |
tree | c7e8d5fa8c358e36c50b197204a29fdaa7475da8 /source/Entity.h | |
parent | Moved BioGen parameter reading from cComposableGenrator into each BioGen itself (diff) | |
download | cuberite-fdcad8a72d6f66d62dcd5893f9ba7bf421043a61.tar cuberite-fdcad8a72d6f66d62dcd5893f9ba7bf421043a61.tar.gz cuberite-fdcad8a72d6f66d62dcd5893f9ba7bf421043a61.tar.bz2 cuberite-fdcad8a72d6f66d62dcd5893f9ba7bf421043a61.tar.lz cuberite-fdcad8a72d6f66d62dcd5893f9ba7bf421043a61.tar.xz cuberite-fdcad8a72d6f66d62dcd5893f9ba7bf421043a61.tar.zst cuberite-fdcad8a72d6f66d62dcd5893f9ba7bf421043a61.zip |
Diffstat (limited to '')
-rw-r--r-- | source/Entity.h | 32 |
1 files changed, 7 insertions, 25 deletions
diff --git a/source/Entity.h b/source/Entity.h index 94f565385..8d8d2690b 100644 --- a/source/Entity.h +++ b/source/Entity.h @@ -11,31 +11,6 @@ -#define CLASS_PROT_ISA() virtual bool IsA(const char * a_EntityType) const override; -#define CLASS_PROT_GETCLASS() virtual const char * GetClass (void) const override; -#define CLASS_PROT_GETPARENT() virtual const char * GetParentClass(void) const override; - -#define CLASS_PROTOTYPE() \ - CLASS_PROT_ISA(); \ - CLASS_PROT_GETCLASS(); \ - CLASS_PROT_GETPARENT(); - -#define CLASS_DEF_ISA(classname) \ - bool classname::IsA(const char * a_ClassName) const \ - { \ - return ((strcmp(a_ClassName, #classname) == 0) || super::IsA(a_ClassName)); \ - } - -#define CLASS_DEF_GETCLASS(classname) \ - const char * classname::GetClass(void) const \ - { \ - return #classname; \ - } - -#define CLASS_DEFINITION(classname) \ - CLASS_DEF_ISA(classname) \ - CLASS_DEF_GETCLASS(classname) - // Place this macro in the header of each cEntity descendant class and you're done :) #define CLASS_PROTODEF(classname) \ virtual bool IsA(const char * a_ClassName) const override\ @@ -46,6 +21,10 @@ { \ return #classname; \ } \ + static const char * GetClassStatic(void) \ + { \ + return #classname; \ + } \ virtual const char * GetParentClass(void) const override \ { \ return super::GetClass(); \ @@ -109,6 +88,9 @@ public: /// Returns the topmost class name for the object virtual const char * GetClass(void) const; + + // Returns the class name of this class + static const char * GetClassStatic(void); /// Returns the topmost class's parent class name for the object. cEntity returns an empty string (no parent). virtual const char * GetParentClass(void) const; |