Open
Description
The extension code generators should be replaced with the C# 14 extensions feature when it lands. This will get rid of about 400,000 lines of generated code and make the wrapper significantly easier to maintain and contribute to as we will only have to write extension methods once and have it be usable by many types.
https://github.com/dotnet/csharplang/blob/main/proposals/extensions.md
public struct Entity : IEntity { ... }
public struct Component<T> : IEntity { ... }
public struct System<T, ...> : IEntity { ... }
public struct Observer<T, ...> : IEntity { ... }
public static class EntityMethods
{
// All types that implement the IEntity interface will receive .Get and .Set methods.
extension<T> (T entity) where T : IEntity
{
public ref TComponent Get<TComponent>()
{
...
}
public ref T Set<TComponent>(TComponent value)
{
...
}
}
}
Metadata
Metadata
Assignees
Labels
No labels