22 #ifndef ULTIMA_SHARED_CORE_BASE_OBJECT_H 23 #define ULTIMA_SHARED_CORE_BASE_OBJECT_H 25 #include "common/scummsys.h" 26 #include "common/array.h" 27 #include "common/hash-str.h" 28 #include "common/list.h" 29 #include "ultima/shared/core/file.h" 37 typedef ClassDef(*ClassDefFn)();
47 const char *_className;
49 ClassDef(
const char *className,
const ClassDefFn parentFn) :
50 _className(className), _parentFn(parentFn) {
53 bool hasParent()
const {
54 return _parentFn !=
nullptr;
57 return (*_parentFn)();
59 bool operator==(
const ClassDef &right)
const {
60 return !strcmp(_className, right._className);
65 static ::Ultima::Shared::ClassDef type(); \ 66 ::Ultima::Shared::ClassDef getType() const override { return type(); } 73 static ::Ultima::Shared::ClassDef type();
74 virtual ::Ultima::Shared::ClassDef getType()
const {
return type(); }
82 bool isInstanceOf(
const ClassDef &classDef)
const;
Definition: detection.h:27
Definition: base_object.h:43
Definition: base_object.h:71