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.meta; 17 import godot.core; 18 import godot.c; 19 import godot.d.bind; 20 import godot.d.reference; 21 import godot.object; 22 import godot.classdb; 23 import godot.reference; 24 /** 25 26 */ 27 @GodotBaseClass struct VisualScriptFunctionState 28 { 29 enum string _GODOT_internal_name = "VisualScriptFunctionState"; 30 public: 31 @nogc nothrow: 32 union { godot_object _godot_object; Reference _GODOT_base; } 33 alias _GODOT_base this; 34 alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses); 35 package(godot) __gshared bool _classBindingInitialized = false; 36 package(godot) static struct _classBinding 37 { 38 __gshared: 39 @GodotName("connect_to_signal") GodotMethod!(void, GodotObject, String, Array) connectToSignal; 40 @GodotName("resume") GodotMethod!(Variant, Array) resume; 41 @GodotName("is_valid") GodotMethod!(bool) isValid; 42 @GodotName("_signal_callback") GodotMethod!(Variant, GodotVarArgs) _signalCallback; 43 } 44 bool opEquals(in VisualScriptFunctionState other) const { return _godot_object.ptr is other._godot_object.ptr; } 45 VisualScriptFunctionState opAssign(T : typeof(null))(T n) { _godot_object.ptr = null; } 46 bool opEquals(typeof(null) n) const { return _godot_object.ptr is null; } 47 mixin baseCasts; 48 static VisualScriptFunctionState _new() 49 { 50 static godot_class_constructor constructor; 51 if(constructor is null) constructor = _godot_api.godot_get_class_constructor("VisualScriptFunctionState"); 52 if(constructor is null) return typeof(this).init; 53 return cast(VisualScriptFunctionState)(constructor()); 54 } 55 @disable new(size_t s); 56 /** 57 58 */ 59 void connectToSignal(StringArg1)(GodotObject obj, in StringArg1 signals, in Array args) 60 { 61 checkClassBinding!(typeof(this))(); 62 ptrcall!(void)(_classBinding.connectToSignal, _godot_object, obj, signals, args); 63 } 64 /** 65 66 */ 67 Variant resume(in Array args = Array.empty_array) 68 { 69 checkClassBinding!(typeof(this))(); 70 return ptrcall!(Variant)(_classBinding.resume, _godot_object, args); 71 } 72 /** 73 74 */ 75 bool isValid() const 76 { 77 checkClassBinding!(typeof(this))(); 78 return ptrcall!(bool)(_classBinding.isValid, _godot_object); 79 } 80 /** 81 82 */ 83 Variant _signalCallback(VarArgs...)(VarArgs varArgs) 84 { 85 Array _GODOT_args = Array.empty_array; 86 foreach(vai, VA; VarArgs) 87 { 88 _GODOT_args.append(varArgs[vai]); 89 } 90 String _GODOT_method_name = String("_signal_callback"); 91 return this.callv(_GODOT_method_name, _GODOT_args); 92 } 93 }