public abstract class State
{
protected State(Character character)
{
Character = character;
}
public Character Character { get; private set; }
public virtual void OnEnter()
{
}
public virtual State OnTick()
{
return this;
}
public virtual void OnExit()
{
}
}
public class Idle : State
{
public Idle(Character character)
: base(character)
{
}
public override State OnTick()
{
Character.Play(Character.Idle);
return this;
}
}