using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Framework.PlasmaStateSystem
{
    public delegate void EnterAction();
    public delegate void UpdateAction();
    public delegate void ExitAction();

    /// <summary>
    /// An object that represents a state of other objects. This 
    /// implementation supplies states with a parent child structure.
    /// </summary>
    public interface Statelike : Transitionable
    {
        string GetName();

        bool IsSubstate(Statelike superstate);

        /// <summary>
        /// Returns a state like object that is capable of handling 
        /// the given spark type.
        /// </summary>
        /// <returns>The state like object that can handle the given spark type.</returns>
        Statelike GetHandler(Sparklike spark);

        /// <summary>
        /// Gets the leaf states of a state like object.
        /// </summary>
        /// <returns>The leaf states.</returns>
        Statelike[] GetLeafStates();

        /// <summary>
        /// Sets the initial states of a state like object, these are the 
        /// states that this will 'fall' into when it is transitioned to.
        /// </summary>
        /// <param name="initialStates">The initial states.</param>
        void SetInitialStates(params Statelike[] initialStates);

        void InvokeUpdate();
    }
}
