lyra-wasm-scripting-test/guests/csharp/dotnet-guest-test/LyraApi/Ecs/Component.cs

21 lines
671 B
C#

using System.Reflection;
using ExampleWorld.wit.imports.lyra.api;
using LyraApi.Ecs;
public class Component(string hostName, ulong hostSize, ulong hostAlignment, ulong typeId)
{
public string HostName { get; } = hostName;
public ulong HostSize { get; } = hostSize;
public ulong HostAlignment { get; } = hostAlignment;
public ulong TypeId { get; } = typeId;
public static Component FromComponent<T>() where T : IComponent
{
return new Component(T.HostName, T.HostSize, T.HostAlignment, T.TypeId);
}
public ComponentInfo GetComponentInfo()
{
return new ComponentInfo(HostName, HostSize, HostAlignment, TypeId);
}
}