Basic Script reloading

+ ScriptComponent now saves script name instead of direct ScriptClass reference
+ Added ClearDictionaryAndDeleteKeys helper
+ Moved ScriptFieldType to separate file
+ _ScriptFieldMap now uses String as Key
This commit is contained in:
Simon Lübeß
2023-07-18 22:06:34 +02:00
parent e8505f6bdb
commit cd1562f372
10 changed files with 259 additions and 166 deletions
+4 -4
View File
@@ -25,13 +25,13 @@ public struct ScriptField
public struct ScriptFieldInstance
{
public ScriptField Field;
public ScriptFieldType Type;
// TODO: I hate this, but we need to be able to store an entire matrix
internal uint8[sizeof(GlitchyEngine.Math.Matrix)] _data;
public this(ScriptField field)
public this(ScriptFieldType type)
{
Field = field;
Type = type;
_data = default;
}
@@ -47,7 +47,7 @@ public struct ScriptFieldInstance
}
}
public typealias ScriptFieldMap = Dictionary<StringView, ScriptFieldInstance>;
public typealias ScriptFieldMap = Dictionary<String, ScriptFieldInstance>;
abstract class SharpType : RefCounter
{