Add pure virtual test
parent
321c8d2b30
commit
ab3db91c92
|
@ -205,4 +205,22 @@ protected:
|
|||
static void _bind_methods() {}
|
||||
};
|
||||
|
||||
class ExamplePureVirtualBase : public Object {
|
||||
GDCLASS(ExamplePureVirtualBase, Object);
|
||||
|
||||
protected:
|
||||
static void _bind_methods() {}
|
||||
|
||||
virtual int test_function() = 0;
|
||||
};
|
||||
|
||||
class ExamplePureVirtual : public ExamplePureVirtualBase {
|
||||
GDCLASS(ExamplePureVirtual, ExamplePureVirtualBase);
|
||||
|
||||
protected:
|
||||
static void _bind_methods() {}
|
||||
|
||||
int test_function() override { return 25; }
|
||||
};
|
||||
|
||||
#endif // EXAMPLE_CLASS_H
|
||||
|
|
|
@ -26,6 +26,9 @@ void initialize_example_module(ModuleInitializationLevel p_level) {
|
|||
ClassDB::register_class<Example>();
|
||||
ClassDB::register_class<ExampleVirtual>(true);
|
||||
ClassDB::register_abstract_class<ExampleAbstract>();
|
||||
|
||||
GDREGISTER_VIRTUAL_CLASS(ExamplePureVirtualBase);
|
||||
GDREGISTER_CLASS(ExamplePureVirtual);
|
||||
}
|
||||
|
||||
void uninitialize_example_module(ModuleInitializationLevel p_level) {
|
||||
|
|
Loading…
Reference in New Issue