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

namespace Framework.PlasmaStateSystem
{
    /// <summary>
    /// An object that can transition from one state to another. An object that implements
    /// this interface should support a list of transitions matched against spark types.
    /// </summary>
    public interface Transitionable
    {
        /// <summary>
        /// Sets a transition on a transitionable instance.
        /// </summary>
        /// <param name="spark">The spark.</param>
        /// <param name="targetState">Target state to change to.</param>
        void SetTransition<SparkType>(Statelike targetState) where SparkType : Sparklike;

        /// <summary>
        /// Sets a transition on a transitionable instance with a condition.
        /// </summary>
        /// <param name="spark">The spark.</param>
        /// <param name="targetState">Target state to change to.</param>
        /// <param name="condition">The condition.</param>
        void SetTransition<SparkType>(Statelike targetState, TransitionCondition condition) where SparkType : Sparklike;

        /// <summary>
        /// Attempts to transition a transitional from one state to another 
        /// by returning the new states of a state machine system. 
        /// </summary>
        /// <param name="spark">The spark.</param>
        /// <returns>The new states.</returns>
        Statelike[] Transition(Sparklike spark);

        void InvokeEnter();

        void InvokeExit();
    }
}
