Debian Codegraph @

modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/Sources/ExportedFields.cs

raw symbols SCIP
1 using Godot;
2 using System;
3 using System.Collections.Generic;
4 using static Godot.Mathf;
5
6 public partial class ExportedFields : GodotObject
7 {
8 [Export] private Boolean _fieldBoolean = true;
9 [Export] private Char _fieldChar = 'f';
10 [Export] private SByte _fieldSByte = 10;
11 [Export] private Int16 _fieldInt16 = 10;
12 [Export] private Int32 _fieldInt32 = 10;
13 [Export] private Int64 _fieldInt64 = -10_000;
14 [Export] private Byte _fieldByte = 10;
15 [Export] private UInt16 _fieldUInt16 = 10;
16 [Export] private UInt32 _fieldUInt32 = 10;
17 [Export] private UInt64 _fieldUInt64 = 10;
18 [Export] private Single _fieldSingle = 10;
19 [Export] private Double _fieldDouble = 10;
20 [Export] private String _fieldString = "foo";
21
22 // Static import
23 [Export] private Single _fieldStaticImport = RadToDeg(2 * Pi);
24
25 // Godot structs
26 [Export] private Vector2 _fieldVector2 = new(10f, 10f);
27 [Export] private Vector2I _fieldVector2I = Vector2I.Up;
28 [Export] private Rect2 _fieldRect2 = new(new Vector2(10f, 10f), new Vector2(10f, 10f));
29 [Export] private Rect2I _fieldRect2I = new(new Vector2I(10, 10), new Vector2I(10, 10));
30 [Export] private Transform2D _fieldTransform2D = Transform2D.Identity;
31 [Export] private Vector3 _fieldVector3 = new(10f, 10f, 10f);
32 [Export] private Vector3I _fieldVector3I = Vector3I.Back;
33 [Export] private Basis _fieldBasis = new Basis(Quaternion.Identity);
34 [Export] private Quaternion _fieldQuaternion = new Quaternion(Basis.Identity);
35 [Export] private Transform3D _fieldTransform3D = Transform3D.Identity;
36 [Export] private Vector4 _fieldVector4 = new(10f, 10f, 10f, 10f);
37 [Export] private Vector4I _fieldVector4I = Vector4I.One;
38 [Export] private Projection _fieldProjection = Projection.Identity;
39 [Export] private Aabb _fieldAabb = new Aabb(10f, 10f, 10f, new Vector3(1f, 1f, 1f));
40 [Export] private Color _fieldColor = Colors.Aquamarine;
41 [Export] private Plane _fieldPlane = Plane.PlaneXZ;
42 [Export] private Callable _fieldCallable = new Callable(Engine.GetMainLoop(), "_process");
43 [Export] private Signal _fieldSignal = new Signal(Engine.GetMainLoop(), "property_list_changed");
44
45 // Enums
46 public enum MyEnum
47 {
48 A,
49 B,
50 C
51 }
52
53 [Export] private MyEnum _fieldEnum = MyEnum.C;
54
55 [Flags]
56 public enum MyFlagsEnum
57 {
58 A,
59 B,
60 C
61 }
62
63 [Export] private MyFlagsEnum _fieldFlagsEnum = MyFlagsEnum.C;
64
65 // Arrays
66 [Export] private Byte[] _fieldByteArray = { 0, 1, 2, 3, 4, 5, 6 };
67 [Export] private Int32[] _fieldInt32Array = { 0, 1, 2, 3, 4, 5, 6 };
68 [Export] private Int64[] _fieldInt64Array = { 0, 1, 2, 3, 4, 5, 6 };
69 [Export] private Single[] _fieldSingleArray = { 0f, 1f, 2f, 3f, 4f, 5f, 6f };
70 [Export] private Double[] _fieldDoubleArray = { 0d, 1d, 2d, 3d, 4d, 5d, 6d };
71 [Export] private String[] _fieldStringArray = { "foo", "bar" };
72 [Export(PropertyHint.Enum, "A,B,C")] private String[] _fieldStringArrayEnum = { "foo", "bar" };
73 [Export] private Vector2[] _fieldVector2Array = { Vector2.Up, Vector2.Down, Vector2.Left, Vector2.Right };
74 [Export] private Vector3[] _fieldVector3Array = { Vector3.Up, Vector3.Down, Vector3.Left, Vector3.Right };
75 [Export] private Color[] _fieldColorArray = { Colors.Aqua, Colors.Aquamarine, Colors.Azure, Colors.Beige };
76 [Export] private GodotObject[] _fieldGodotObjectOrDerivedArray = { null };
77 [Export] private StringName[] _fieldStringNameArray = { "foo", "bar" };
78 [Export] private NodePath[] _fieldNodePathArray = { "foo", "bar" };
79 [Export] private Rid[] _fieldRidArray = { default, default, default };
80 // Note we use Array and not System.Array. This tests the generated namespace qualification.
81 [Export] private Int32[] _fieldEmptyInt32Array = Array.Empty<Int32>();
82 // Note we use List and not System.Collections.Generic.
83 [Export] private int[] _fieldArrayFromList = new List<int>(Array.Empty<int>()).ToArray();
84
85 // Variant
86 [Export] private Variant _fieldVariant = "foo";
87
88 // Classes
89 [Export] private GodotObject _fieldGodotObjectOrDerived;
90 [Export] private Godot.Texture _fieldGodotResourceTexture;
91 [Export] private Godot.Texture _fieldGodotResourceTextureWithInitializer = new() { ResourceName = "" };
92 [Export] private StringName _fieldStringName = new StringName("foo");
93 [Export] private NodePath _fieldNodePath = new NodePath("foo");
94 [Export] private Rid _fieldRid;
95
96 [Export]
97 private Godot.Collections.Dictionary _fieldGodotDictionary = new() { { "foo", 10 }, { Vector2.Up, Colors.Chocolate } };
98
99 [Export]
100 private Godot.Collections.Array _fieldGodotArray = new() { "foo", 10, Vector2.Up, Colors.Chocolate };
101
102 [Export]
103 private Godot.Collections.Dictionary<string, bool> _fieldGodotGenericDictionary = new() { { "foo", true }, { "bar", false } };
104
105 [Export]
106 private Godot.Collections.Array<int> _fieldGodotGenericArray = new() { 0, 1, 2, 3, 4, 5, 6 };
107 }