refactor: removed unnecessary overrides from Behaviour class
This commit is contained in:
@@ -3,7 +3,7 @@ using Syntriax.Engine.Core.Serialization;
|
||||
|
||||
namespace Syntriax.Engine.Systems.StateMachine;
|
||||
|
||||
public class StateMachine : Behaviour
|
||||
public class StateMachine : Behaviour, IUpdate
|
||||
{
|
||||
public Event<StateMachine, StateChangedArguments> OnStateChanged { get; } = new();
|
||||
|
||||
@@ -44,7 +44,7 @@ public class StateMachine : Behaviour
|
||||
State = nextState;
|
||||
}
|
||||
|
||||
protected override void OnUpdate()
|
||||
public void Update()
|
||||
{
|
||||
if (State is null)
|
||||
return;
|
||||
|
@@ -2,7 +2,7 @@ using Syntriax.Engine.Core;
|
||||
|
||||
namespace Syntriax.Engine.Systems.Time;
|
||||
|
||||
public class StopwatchBehaviour : Behaviour, IStopwatch
|
||||
public class StopwatchBehaviour : Behaviour, IUpdate, IStopwatch
|
||||
{
|
||||
public Event<IReadOnlyStopwatch> OnStarted { get; } = new();
|
||||
public Event<IReadOnlyStopwatch, IReadOnlyStopwatch.StopwatchDeltaArguments> OnDelta { get; } = new();
|
||||
@@ -38,7 +38,7 @@ public class StopwatchBehaviour : Behaviour, IStopwatch
|
||||
OnStopped?.Invoke(this);
|
||||
}
|
||||
|
||||
protected override void OnUpdate()
|
||||
public virtual void Update()
|
||||
{
|
||||
if (State is not TimerState.Ticking)
|
||||
return;
|
||||
|
@@ -18,9 +18,9 @@ public class TickerBehaviour : StopwatchBehaviour, ITicker
|
||||
nextTick = Time + Period;
|
||||
}
|
||||
|
||||
protected override void OnUpdate()
|
||||
public override void Update()
|
||||
{
|
||||
base.OnUpdate();
|
||||
base.Update();
|
||||
|
||||
while (Time > nextTick)
|
||||
{
|
||||
|
@@ -2,7 +2,7 @@ using Syntriax.Engine.Core;
|
||||
|
||||
namespace Syntriax.Engine.Systems.Time;
|
||||
|
||||
public class TimerBehaviour : Behaviour, ITimer
|
||||
public class TimerBehaviour : Behaviour, IUpdate, ITimer
|
||||
{
|
||||
public Event<IReadOnlyTimer> OnStarted { get; } = new();
|
||||
public Event<IReadOnlyTimer, IReadOnlyTimer.TimerDeltaArguments> OnDelta { get; } = new();
|
||||
@@ -53,7 +53,7 @@ public class TimerBehaviour : Behaviour, ITimer
|
||||
OnStopped?.Invoke(this);
|
||||
}
|
||||
|
||||
protected override void OnUpdate()
|
||||
public void Update()
|
||||
{
|
||||
if (State is not TimerState.Ticking)
|
||||
return;
|
||||
|
Reference in New Issue
Block a user