1 /** 2 3 4 Copyright: 5 Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. 6 Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) 7 Copyright (c) 2017-2018 Godot-D contributors 8 9 License: $(LINK2 https://opensource.org/licenses/MIT, MIT License) 10 11 12 */ 13 module godot.visualscriptfunctionstate; 14 import std.meta : AliasSeq, staticIndexOf; 15 import std.traits : Unqual; 16 import godot.d.traits; 17 import godot.core; 18 import godot.c; 19 import godot.d.bind; 20 import godot.d.reference; 21 import godot.globalenums; 22 import godot.object; 23 import godot.classdb; 24 import godot.reference; 25 /** 26 27 */ 28 @GodotBaseClass struct VisualScriptFunctionState 29 { 30 package(godot) enum string _GODOT_internal_name = "VisualScriptFunctionState"; 31 public: 32 @nogc nothrow: 33 union { /** */ godot_object _godot_object; /** */ Reference _GODOT_base; } 34 alias _GODOT_base this; 35 alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses); 36 package(godot) __gshared bool _classBindingInitialized = false; 37 package(godot) static struct GDNativeClassBinding 38 { 39 __gshared: 40 @GodotName("_signal_callback") GodotMethod!(Variant, GodotVarArgs) _signalCallback; 41 @GodotName("connect_to_signal") GodotMethod!(void, GodotObject, String, Array) connectToSignal; 42 @GodotName("is_valid") GodotMethod!(bool) isValid; 43 @GodotName("resume") GodotMethod!(Variant, Array) resume; 44 } 45 /// 46 pragma(inline, true) bool opEquals(in VisualScriptFunctionState other) const 47 { return _godot_object.ptr is other._godot_object.ptr; } 48 /// 49 pragma(inline, true) typeof(null) opAssign(typeof(null) n) 50 { _godot_object.ptr = n; return null; } 51 /// 52 pragma(inline, true) bool opEquals(typeof(null) n) const 53 { return _godot_object.ptr is n; } 54 /// 55 size_t toHash() const @trusted { return cast(size_t)_godot_object.ptr; } 56 mixin baseCasts; 57 /// Construct a new instance of VisualScriptFunctionState. 58 /// Note: use `memnew!VisualScriptFunctionState` instead. 59 static VisualScriptFunctionState _new() 60 { 61 static godot_class_constructor constructor; 62 if(constructor is null) constructor = _godot_api.godot_get_class_constructor("VisualScriptFunctionState"); 63 if(constructor is null) return typeof(this).init; 64 return cast(VisualScriptFunctionState)(constructor()); 65 } 66 @disable new(size_t s); 67 /** 68 69 */ 70 Variant _signalCallback(VarArgs...)(VarArgs varArgs) 71 { 72 Array _GODOT_args = Array.make(); 73 foreach(vai, VA; VarArgs) 74 { 75 _GODOT_args.append(varArgs[vai]); 76 } 77 String _GODOT_method_name = String("_signal_callback"); 78 return this.callv(_GODOT_method_name, _GODOT_args); 79 } 80 /** 81 82 */ 83 void connectToSignal(GodotObject obj, in String signals, in Array args) 84 { 85 checkClassBinding!(typeof(this))(); 86 ptrcall!(void)(GDNativeClassBinding.connectToSignal, _godot_object, obj, signals, args); 87 } 88 /** 89 90 */ 91 bool isValid() const 92 { 93 checkClassBinding!(typeof(this))(); 94 return ptrcall!(bool)(GDNativeClassBinding.isValid, _godot_object); 95 } 96 /** 97 98 */ 99 Variant resume(in Array args = Array.make()) 100 { 101 checkClassBinding!(typeof(this))(); 102 return ptrcall!(Variant)(GDNativeClassBinding.resume, _godot_object, args); 103 } 104 }