mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-26 13:08:24 +01:00
117 lines
4.2 KiB
C#
117 lines
4.2 KiB
C#
// <auto-generated/>
|
|
// Generated by Brutal.Jolt.Generate; do not edit by hand.
|
|
#nullable enable
|
|
|
|
using Brutal.Interop;
|
|
using Brutal.Numerics;
|
|
namespace Brutal.JoltApi
|
|
{
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Core/Factory.h#L13">Jolt/Core/Factory.h:13</see>
|
|
/// <br/>
|
|
/// <c>class Factory</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// This class is responsible for creating instances of classes based on their name or hash and is mainly used
|
|
/// for deserialization of saved data.
|
|
/// </para>
|
|
/// </remarks>
|
|
[InteropHandle]
|
|
public readonly partial struct Factory : IDisposable
|
|
{
|
|
public static Factory Create() => Jolt.PInvoke.Factory_Create();
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Core/Factory.h#L19">Jolt/Core/Factory.h:19</see>
|
|
/// <br/>
|
|
/// <c>void * CreateObject(const char *inName)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Create an object
|
|
/// </para>
|
|
/// </remarks>
|
|
public unsafe Ptr CreateObject(RefString8 name)
|
|
{
|
|
fixed (byte* name_fixed = name)
|
|
{
|
|
return Jolt.PInvoke.Factory_CreateObject(this, name_fixed);
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Core/Factory.h#L22">Jolt/Core/Factory.h:22</see>
|
|
/// <br/>
|
|
/// <c>const RTTI * Find(const char *inName)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Find type info for a specific class by name
|
|
/// </para>
|
|
/// <para>
|
|
/// The returned handle is borrowed from its owner; don't Dispose it.
|
|
/// </para>
|
|
/// </remarks>
|
|
public unsafe RTTI Find(RefString8 name)
|
|
{
|
|
fixed (byte* name_fixed = name)
|
|
{
|
|
return Jolt.PInvoke.Factory_Find(this, name_fixed);
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Core/Factory.h#L25">Jolt/Core/Factory.h:25</see>
|
|
/// <br/>
|
|
/// <c>const RTTI * Find(uint32 inHash)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Find type info for a specific class by hash
|
|
/// </para>
|
|
/// <para>
|
|
/// The returned handle is borrowed from its owner; don't Dispose it.
|
|
/// </para>
|
|
/// </remarks>
|
|
public RTTI Find(uint hash) => Jolt.PInvoke.Factory_Find_2(this, hash);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Core/Factory.h#L28">Jolt/Core/Factory.h:28</see>
|
|
/// <br/>
|
|
/// <c>bool Register(const RTTI *inRTTI)</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Register an object with the factory. Returns false on failure.
|
|
/// </para>
|
|
/// </remarks>
|
|
public bool Register(RTTI rTTI) => Jolt.PInvoke.Factory_Register(this, rTTI);
|
|
/// <summary>
|
|
/// <para>
|
|
/// C++:
|
|
/// <see href="https://github.com/jrouwe/JoltPhysics/blob/23dadd0e603f1b321142d4c74df07fce85064989/Jolt/Core/Factory.h#L34">Jolt/Core/Factory.h:34</see>
|
|
/// <br/>
|
|
/// <c>void Clear()</c>
|
|
/// </para>
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Unregisters all types
|
|
/// </para>
|
|
/// </remarks>
|
|
public void Clear() => Jolt.PInvoke.Factory_Clear(this);
|
|
public void Dispose() => Jolt.PInvoke.Factory_Destroy(this);
|
|
}
|
|
}
|