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.visualscriptoperator;
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.visualscriptnode;
24 import godot.resource;
25 import godot.reference;
26 /**
27 $(B Input Ports:)
28 - Data (variant): `A`
29 - Data (variant): `B`
30 $(B Output Ports:)
31 - Data (variant): `result`
32 */
33 @GodotBaseClass struct VisualScriptOperator
34 {
35 	enum string _GODOT_internal_name = "VisualScriptOperator";
36 public:
37 @nogc nothrow:
38 	union { godot_object _godot_object; VisualScriptNode _GODOT_base; }
39 	alias _GODOT_base this;
40 	alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses);
41 	package(godot) __gshared bool _classBindingInitialized = false;
42 	package(godot) static struct _classBinding
43 	{
44 		__gshared:
45 		@GodotName("set_operator") GodotMethod!(void, long) setOperator;
46 		@GodotName("get_operator") GodotMethod!(Variant.Operator) getOperator;
47 		@GodotName("set_typed") GodotMethod!(void, long) setTyped;
48 		@GodotName("get_typed") GodotMethod!(Variant.Type) getTyped;
49 	}
50 	bool opEquals(in VisualScriptOperator other) const { return _godot_object.ptr is other._godot_object.ptr; }
51 	VisualScriptOperator opAssign(T : typeof(null))(T n) { _godot_object.ptr = null; }
52 	bool opEquals(typeof(null) n) const { return _godot_object.ptr is null; }
53 	mixin baseCasts;
54 	static VisualScriptOperator _new()
55 	{
56 		static godot_class_constructor constructor;
57 		if(constructor is null) constructor = _godot_api.godot_get_class_constructor("VisualScriptOperator");
58 		if(constructor is null) return typeof(this).init;
59 		return cast(VisualScriptOperator)(constructor());
60 	}
61 	@disable new(size_t s);
62 	/**
63 	
64 	*/
65 	void setOperator(in long op)
66 	{
67 		checkClassBinding!(typeof(this))();
68 		ptrcall!(void)(_classBinding.setOperator, _godot_object, op);
69 	}
70 	/**
71 	
72 	*/
73 	Variant.Operator getOperator() const
74 	{
75 		checkClassBinding!(typeof(this))();
76 		return ptrcall!(Variant.Operator)(_classBinding.getOperator, _godot_object);
77 	}
78 	/**
79 	
80 	*/
81 	void setTyped(in long type)
82 	{
83 		checkClassBinding!(typeof(this))();
84 		ptrcall!(void)(_classBinding.setTyped, _godot_object, type);
85 	}
86 	/**
87 	
88 	*/
89 	Variant.Type getTyped() const
90 	{
91 		checkClassBinding!(typeof(this))();
92 		return ptrcall!(Variant.Type)(_classBinding.getTyped, _godot_object);
93 	}
94 	/**
95 	
96 	*/
97 	@property Variant.Operator operator()
98 	{
99 		return getOperator();
100 	}
101 	/// ditto
102 	@property void operator(long v)
103 	{
104 		setOperator(v);
105 	}
106 	/**
107 	
108 	*/
109 	@property Variant.Type type()
110 	{
111 		return getTyped();
112 	}
113 	/// ditto
114 	@property void type(long v)
115 	{
116 		setTyped(v);
117 	}
118 }