refactoring again
This commit is contained in:
@@ -76,12 +76,7 @@ namespace UntitledLogicGame.Workspace
|
||||
// Update is called once per frame
|
||||
private void Update()
|
||||
{
|
||||
var state = Definition.GetState(this).ToInt();
|
||||
if(state != _lastState)
|
||||
{
|
||||
Definition.Compute(this);
|
||||
_lastState = state;
|
||||
}
|
||||
UpdateState();
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -100,6 +95,16 @@ namespace UntitledLogicGame.Workspace
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private void UpdateState()
|
||||
{
|
||||
var state = Definition.GetState(this).ToInt();
|
||||
if (state != _lastState)
|
||||
{
|
||||
Definition.Compute(this);
|
||||
_lastState = state;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user