mirror of
https://github.com/AlexMacocian/MonoGame.Extended.git
synced 2026-07-24 03:56:31 +00:00
23 lines
584 B
C#
23 lines
584 B
C#
using MonoGame.Extended.Collections;
|
|
|
|
namespace MonoGame.Extended.Entities
|
|
{
|
|
public class ComponentManager
|
|
{
|
|
public ComponentManager()
|
|
{
|
|
_mappers = new Bag<ComponentMapper>();
|
|
}
|
|
|
|
private readonly Bag<ComponentMapper> _mappers;
|
|
|
|
public void RegisterComponentType<T>()
|
|
where T : class
|
|
{
|
|
var index = _mappers.Count;
|
|
var componentType = new ComponentType(typeof(T), index);
|
|
var mapper = new ComponentMapper<T>();
|
|
_mappers[index] = mapper;
|
|
}
|
|
}
|
|
} |