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

namespace Framework.PlasmaStateSystem
{
    public delegate bool TransitionCondition();

    /// <summary>
    /// An object that represents a transition from one state to another. Contains
    /// a target state and the option to check a guard condition.
    /// </summary>
    public interface Transitionlike
    {
        /// <summary>
        /// If the <see cref="TransitionCondition"/> of this transition like
        /// object evaluates as true this returns the state object stored by
        /// the transition, otherwise it returns false.
        /// </summary>
        /// <returns>The state that this transition like will change to.</returns>
        Statelike GetState();

        /// <summary>
        /// Gets the condition of this transition like object. This condition
        /// can be used to check whether or not the transition can pass.
        /// </summary>
        /// <returns>The condidition that this transition like needs to pass.</returns>
        TransitionCondition GetCondition();

        /// <summary>
        /// Does this transition like object use conditions to check if this
        /// transition can pass.
        /// </summary>
        /// <returns>Whether or not this transition like object requires 
        /// a condition to pass.</returns>
        bool IsConditional();

        /// <summary>
        /// Returns true if the condition on this transition passes.
        /// </summary>
        /// <returns></returns>
        bool Passes();
    }
}
