mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 21:01:52 +00:00
33 lines
711 B
Beef
33 lines
711 B
Beef
namespace GlitchyEngine.World
|
|
{
|
|
class ScriptableEntity
|
|
{
|
|
internal Entity _entity;
|
|
|
|
protected TransformComponent* transform => GetComponent<TransformComponent>();
|
|
|
|
public T* AddComponent<T>(T value = T()) where T: struct, new
|
|
{
|
|
return _entity.AddComponent<T>(value);
|
|
}
|
|
|
|
public T* GetComponent<T>() where T: struct, new
|
|
{
|
|
return _entity.GetComponent<T>();
|
|
}
|
|
|
|
public bool HasComponent<T>() where T: struct, new
|
|
{
|
|
return _entity.HasComponent<T>();
|
|
}
|
|
|
|
public void RemoveComponent<T>() where T: struct, new
|
|
{
|
|
_entity.RemoveComponent<T>();
|
|
}
|
|
|
|
protected virtual void OnCreate() {}
|
|
protected virtual void OnDestroy() {}
|
|
protected virtual void OnUpdate(GameTime gt) {}
|
|
}
|
|
} |