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.visualscriptyield; 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.visualscriptnode; 25 import godot.resource; 26 import godot.reference; 27 /** 28 29 */ 30 @GodotBaseClass struct VisualScriptYield 31 { 32 package(godot) enum string _GODOT_internal_name = "VisualScriptYield"; 33 public: 34 @nogc nothrow: 35 union { /** */ godot_object _godot_object; /** */ VisualScriptNode _GODOT_base; } 36 alias _GODOT_base this; 37 alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses); 38 package(godot) __gshared bool _classBindingInitialized = false; 39 package(godot) static struct GDNativeClassBinding 40 { 41 __gshared: 42 @GodotName("get_wait_time") GodotMethod!(double) getWaitTime; 43 @GodotName("get_yield_mode") GodotMethod!(VisualScriptYield.YieldMode) getYieldMode; 44 @GodotName("set_wait_time") GodotMethod!(void, double) setWaitTime; 45 @GodotName("set_yield_mode") GodotMethod!(void, long) setYieldMode; 46 } 47 /// 48 pragma(inline, true) bool opEquals(in VisualScriptYield other) const 49 { return _godot_object.ptr is other._godot_object.ptr; } 50 /// 51 pragma(inline, true) typeof(null) opAssign(typeof(null) n) 52 { _godot_object.ptr = n; return null; } 53 /// 54 pragma(inline, true) bool opEquals(typeof(null) n) const 55 { return _godot_object.ptr is n; } 56 /// 57 size_t toHash() const @trusted { return cast(size_t)_godot_object.ptr; } 58 mixin baseCasts; 59 /// Construct a new instance of VisualScriptYield. 60 /// Note: use `memnew!VisualScriptYield` instead. 61 static VisualScriptYield _new() 62 { 63 static godot_class_constructor constructor; 64 if(constructor is null) constructor = _godot_api.godot_get_class_constructor("VisualScriptYield"); 65 if(constructor is null) return typeof(this).init; 66 return cast(VisualScriptYield)(constructor()); 67 } 68 @disable new(size_t s); 69 /// 70 enum YieldMode : int 71 { 72 /** 73 74 */ 75 yieldFrame = 1, 76 /** 77 78 */ 79 yieldPhysicsFrame = 2, 80 /** 81 82 */ 83 yieldWait = 3, 84 } 85 /// 86 enum Constants : int 87 { 88 yieldFrame = 1, 89 yieldPhysicsFrame = 2, 90 yieldWait = 3, 91 } 92 /** 93 94 */ 95 double getWaitTime() 96 { 97 checkClassBinding!(typeof(this))(); 98 return ptrcall!(double)(GDNativeClassBinding.getWaitTime, _godot_object); 99 } 100 /** 101 102 */ 103 VisualScriptYield.YieldMode getYieldMode() 104 { 105 checkClassBinding!(typeof(this))(); 106 return ptrcall!(VisualScriptYield.YieldMode)(GDNativeClassBinding.getYieldMode, _godot_object); 107 } 108 /** 109 110 */ 111 void setWaitTime(in double sec) 112 { 113 checkClassBinding!(typeof(this))(); 114 ptrcall!(void)(GDNativeClassBinding.setWaitTime, _godot_object, sec); 115 } 116 /** 117 118 */ 119 void setYieldMode(in long mode) 120 { 121 checkClassBinding!(typeof(this))(); 122 ptrcall!(void)(GDNativeClassBinding.setYieldMode, _godot_object, mode); 123 } 124 /** 125 126 */ 127 @property VisualScriptYield.YieldMode mode() 128 { 129 return getYieldMode(); 130 } 131 /// ditto 132 @property void mode(long v) 133 { 134 setYieldMode(v); 135 } 136 /** 137 138 */ 139 @property double waitTime() 140 { 141 return getWaitTime(); 142 } 143 /// ditto 144 @property void waitTime(double v) 145 { 146 setWaitTime(v); 147 } 148 }