1 /**
2 Creates a new $(D Resource) or loads one from the filesystem.
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.visualscriptpreload;
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 Creates a new $(D Resource) or loads one from the filesystem.
29 
30 $(B Input Ports:)
31 none
32 $(B Output Ports:)
33 - Data (object): `res`
34 */
35 @GodotBaseClass struct VisualScriptPreload
36 {
37 	package(godot) enum string _GODOT_internal_name = "VisualScriptPreload";
38 public:
39 @nogc nothrow:
40 	union { /** */ godot_object _godot_object; /** */ VisualScriptNode _GODOT_base; }
41 	alias _GODOT_base this;
42 	alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses);
43 	package(godot) __gshared bool _classBindingInitialized = false;
44 	package(godot) static struct GDNativeClassBinding
45 	{
46 		__gshared:
47 		@GodotName("get_preload") GodotMethod!(Resource) getPreload;
48 		@GodotName("set_preload") GodotMethod!(void, Resource) setPreload;
49 	}
50 	/// 
51 	pragma(inline, true) bool opEquals(in VisualScriptPreload other) const
52 	{ return _godot_object.ptr is other._godot_object.ptr; }
53 	/// 
54 	pragma(inline, true) typeof(null) opAssign(typeof(null) n)
55 	{ _godot_object.ptr = n; return null; }
56 	/// 
57 	pragma(inline, true) bool opEquals(typeof(null) n) const
58 	{ return _godot_object.ptr is n; }
59 	/// 
60 	size_t toHash() const @trusted { return cast(size_t)_godot_object.ptr; }
61 	mixin baseCasts;
62 	/// Construct a new instance of VisualScriptPreload.
63 	/// Note: use `memnew!VisualScriptPreload` instead.
64 	static VisualScriptPreload _new()
65 	{
66 		static godot_class_constructor constructor;
67 		if(constructor is null) constructor = _godot_api.godot_get_class_constructor("VisualScriptPreload");
68 		if(constructor is null) return typeof(this).init;
69 		return cast(VisualScriptPreload)(constructor());
70 	}
71 	@disable new(size_t s);
72 	/**
73 	
74 	*/
75 	Ref!Resource getPreload() const
76 	{
77 		checkClassBinding!(typeof(this))();
78 		return ptrcall!(Resource)(GDNativeClassBinding.getPreload, _godot_object);
79 	}
80 	/**
81 	
82 	*/
83 	void setPreload(Resource resource)
84 	{
85 		checkClassBinding!(typeof(this))();
86 		ptrcall!(void)(GDNativeClassBinding.setPreload, _godot_object, resource);
87 	}
88 	/**
89 	The $(D Resource) to load.
90 	*/
91 	@property Resource resource()
92 	{
93 		return getPreload();
94 	}
95 	/// ditto
96 	@property void resource(Resource v)
97 	{
98 		setPreload(v);
99 	}
100 }