1 /** 2 Branches program flow based on a given input's value. 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.visualscriptswitch; 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 Branches program flow based on a given input's value. 29 30 Branches the flow based on an input's value. Use $(B Case Count) in the Inspector to set the number of branches and each comparison's optional type. 31 $(B Input Ports:) 32 - Sequence: `'input' is` 33 - Data (variant): `=` 34 - Data (variant): `=` (optional) 35 - Data (variant): `input` 36 $(B Output Ports:) 37 - Sequence 38 - Sequence (optional) 39 - Sequence: `done` 40 */ 41 @GodotBaseClass struct VisualScriptSwitch 42 { 43 package(godot) enum string _GODOT_internal_name = "VisualScriptSwitch"; 44 public: 45 @nogc nothrow: 46 union { /** */ godot_object _godot_object; /** */ VisualScriptNode _GODOT_base; } 47 alias _GODOT_base this; 48 alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses); 49 package(godot) __gshared bool _classBindingInitialized = false; 50 package(godot) static struct GDNativeClassBinding 51 { 52 __gshared: 53 } 54 /// 55 pragma(inline, true) bool opEquals(in VisualScriptSwitch other) const 56 { return _godot_object.ptr is other._godot_object.ptr; } 57 /// 58 pragma(inline, true) typeof(null) opAssign(typeof(null) n) 59 { _godot_object.ptr = n; return null; } 60 /// 61 pragma(inline, true) bool opEquals(typeof(null) n) const 62 { return _godot_object.ptr is n; } 63 /// 64 size_t toHash() const @trusted { return cast(size_t)_godot_object.ptr; } 65 mixin baseCasts; 66 /// Construct a new instance of VisualScriptSwitch. 67 /// Note: use `memnew!VisualScriptSwitch` instead. 68 static VisualScriptSwitch _new() 69 { 70 static godot_class_constructor constructor; 71 if(constructor is null) constructor = _godot_api.godot_get_class_constructor("VisualScriptSwitch"); 72 if(constructor is null) return typeof(this).init; 73 return cast(VisualScriptSwitch)(constructor()); 74 } 75 @disable new(size_t s); 76 }