Skip to content

Commit e370d5e

Browse files
committed
[#25] feat(DaedalusSymbol): add GetInstance and SetInstance APIs
1 parent e23af9d commit e370d5e

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

ZenKit/DaedalusScript.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,16 @@ public int GetInt(ushort index, DaedalusInstance? context = null)
137137
return Native.ZkDaedalusSymbol_getInt(Handle, index, context?.Handle ?? UIntPtr.Zero);
138138
}
139139

140+
public DaedalusInstance? GetInstance()
141+
{
142+
return DaedalusInstance.FromNative(Native.ZkDaedalusSymbol_getInstance(Handle));
143+
}
144+
145+
public void SetInstance(DaedalusInstance? instance)
146+
{
147+
Native.ZkDaedalusSymbol_setInstance(Handle, instance?.Handle ?? UIntPtr.Zero);
148+
}
149+
140150
public void SetString(string value, ushort index, DaedalusInstance? context = null)
141151
{
142152
Native.ZkDaedalusSymbol_setString(Handle, value, index, context?.Handle ?? UIntPtr.Zero);

ZenKit/Native.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4165,12 +4165,18 @@ public static extern void ZkDaedalusScript_enumerateInstanceSymbols(UIntPtr slf,
41654165

41664166
[DllImport(DllName)]
41674167
public static extern void ZkDaedalusSymbol_setString(UIntPtr slf, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(GothicStringMarshaller))] string value, ushort index, UIntPtr context);
4168+
4169+
[DllImport(DllName)]
4170+
public static extern UIntPtr ZkDaedalusSymbol_getInstance(UIntPtr slf);
41684171

41694172
[DllImport(DllName)]
41704173
public static extern void ZkDaedalusSymbol_setFloat(UIntPtr slf, float value, ushort index, UIntPtr context);
41714174

41724175
[DllImport(DllName)]
41734176
public static extern void ZkDaedalusSymbol_setInt(UIntPtr slf, int value, ushort index, UIntPtr context);
4177+
4178+
[DllImport(DllName)]
4179+
public static extern void ZkDaedalusSymbol_setInstance(UIntPtr slf, UIntPtr value);
41744180

41754181
[DllImport(DllName)]
41764182
public static extern bool ZkDaedalusSymbol_getIsConst(UIntPtr slf);

0 commit comments

Comments
 (0)