using System;

/// <summary>
///     Simple state class with Enter, Exit and Update states.
///     Either derive your own, or customize this one.
///     Can use delegate actions or override the virtual functions.
/// </summary>
public class State
{
    public Action StateEnter;
    public Action StateExit;
    public Action StateUpdate;

    protected State(Action enter = null, Action update = null, Action exit = null)
    {
        StateEnter += enter;
        StateEnter += Enter;

        StateUpdate += update;
        StateUpdate += Update;

        StateExit += exit;
        StateExit += Exit;
    }

    protected virtual void Enter()
    {
    }

    protected virtual void Update()
    {
    }

    protected virtual void Exit()
    {
    }
}