TimerAction.cs

src/Updates/TimerAction.cs · 2.2 KB

From the archive Arthea-src-1.0.zip

Download the archive   « Back to the archive contents

#region Arthea License

/***********************************************************************
*  Arthea MUD by R. Jennings (2007)      http://arthea.googlecode.com/ *
*  By using this code you comply with the Artistic and GPLv2 Licenses. *
***********************************************************************/

#endregion

// Taken from Suroden (http://sourceforge.net/projects/suroden)
// and modified for Arthea.
// - RJ, Aug'07

using System;

namespace Arthea.Updates
{
    /// <summary>
    /// Summary description for TimerAction.
    /// </summary>
    public class TimerAction : IComparable
    {
        #region [rgn] Fields (2)

        /// <summary>
        /// the interval
        /// </summary>
        public double interval = -1;

        /// <summary>
        /// The time
        /// </summary>
        public double time;

        #endregion [rgn]

        #region [rgn] Methods (1)

        // [rgn] Public Methods (1)

        /// <summary>
        /// Executes this instance.
        /// </summary>
        public virtual void Execute()
        {
        }

        #endregion [rgn]

        #region IComparable Members

        /// <summary>
        /// Compares the current instance with another object of the same type.
        /// </summary>
        /// <param name="obj">An object to compare with this instance.</param>
        /// <returns>
        /// A 32-bit signed integer that indicates the relative order of the objects being compared. The return value has these meanings: Value Meaning Less than zero This instance is less than obj. Zero This instance is equal to obj. Greater than zero This instance is greater than obj.
        /// </returns>
        /// <exception cref="T:System.ArgumentException">obj is not the same type as this instance. </exception>
        public int CompareTo(object obj)
        {
            if (obj is TimerAction)
            {
                TimerAction a = obj as TimerAction;

                return time.CompareTo(a.time);
            }

            throw new ArgumentException("Only TimerAction is supported", "obj");
        }

        #endregion
    }
}

Site Stats

Snippets: 1791
Codebases: 571