using System;
using Chernobyl.Collections.Generic.Event;
using Chernobyl.Dependency;
using Chernobyl.Measures.Time;
using Chernobyl.Update;
using Chernobyl.Utility;
namespace Chernobyl.StateMachine
{
///
/// An that performs the following:
///
///
/// When the
/// is entered (i.e. is raised) the
/// instance will start a countdown (the
/// count of which is specified by the user).
///
///
/// When the countdown reaches 0, the
/// instance will set the instance onto the
/// of its .
/// This will, of course, cause the to become
/// an inactive (i.e.
/// will be raised).
///
///
/// If the instance becomes
/// an inactive before the countdown has
/// reached 0, the countdown will be paused and
/// will not become the active state. The countdown can be reactivated
/// and returned to its previous count by activating the
/// again.
///
///
///
public class Countdown : UpdateableState
{
///
/// Initializes a new instance of the class.
///
/// The instance that takes services and gives
/// them out.
/// The instance that is to become the active state
/// (i.e. set on the property) of this
/// ) after the countdown timer has reached 0 or
/// null if null is to be set on the
/// property.
/// The amount of time, in milliseconds, between this
/// becoming active and the
/// becoming active.
/// Thrown if
/// is null.
/// Thrown if
/// is less than or equal to zero.
public Countdown(IEventCollection