Big restructuring - sample game is currently broken

This commit is contained in:
Maddy Thorson
2021-02-04 23:11:51 -08:00
parent 05c79b296e
commit 3d5130b45b
28 changed files with 551 additions and 866 deletions

View File

@ -4,7 +4,7 @@ using System.Diagnostics;
namespace Strawberry
{
public class StateMachine<TIndex> : Component where TIndex : struct, IHashable
public class StateMachine<TIndex> : Component, IUpdate where TIndex : struct, IHashable
{
private Dictionary<TIndex, State> states = new Dictionary<TIndex, State>() ~ delete _;
private TIndex state;
@ -14,7 +14,6 @@ namespace Strawberry
public TIndex NextState { get; private set; }
public this(TIndex startState)
: base(true, false)
{
NextState = PreviousState = state = startState;
}
@ -30,7 +29,7 @@ namespace Strawberry
CallEnter();
}
public override void Update()
public void Update()
{
CallUpdate();
}