StateMachine Component

This commit is contained in:
Matt Thorson
2020-05-26 21:23:46 -07:00
parent aed77272ac
commit be9e1cd877
5 changed files with 171 additions and 36 deletions

View File

@ -15,30 +15,19 @@ namespace Strawberry
Visible = visible;
}
public void Added(Entity entity)
private void Added(Entity entity)
{
Entity = entity;
}
public void Removed()
private void Removed()
{
Entity = null;
}
public virtual void Started()
{
}
public virtual void Update()
{
}
public virtual void Draw()
{
}
public abstract void Started();
public abstract void Update();
public abstract void Draw();
[Inline]
public void RemoveSelf()

View File

@ -89,7 +89,7 @@ namespace Strawberry
{
components.Remove(c);
Scene.[Friend]UntrackComponent(c);
c.Removed();
c.[Friend]Removed();
delete c;
}
@ -102,7 +102,7 @@ namespace Strawberry
{
components.Add(c);
Scene.[Friend]TrackComponent(c);
c.Added(this);
c.[Friend]Added(this);
}
toAdd.Clear();