示例#1
0
 /// <summary>
 /// Compares this <see cref="ITimeSensitive"/> instance with the given one.
 /// </summary>
 /// <returns>
 /// A value smaller than zero if this instance will take place before the given one, a value larger than zero if this event
 /// will take place after the given one, zero if both events will be triggered at the same time.
 /// </returns>
 /// <param name='other'>
 /// The <see cref="ITimeSensitive"/> instance to compare with.
 /// </param>
 /// <remarks>
 /// <para>In case the given <see cref="ITimeSensitive"/> is not effective, a negative value is returned.</para>
 /// </remarks>
 public int CompareTo(ITimeSensitive other)
 {
     if (other != null)
     {
         return(this.Time.CompareTo(other.Time));
     }
     else
     {
         return(-0x01);
     }
 }
示例#2
0
        public override int CompareTo(ITimeSensitive other)
        {
            int comp = base.CompareTo(other);

            if (comp != 0x00)
            {
                return(comp);
            }
            else if (other is ShapeStateModifier)
            {
                ShapeStateModifier mod = (ShapeStateModifier)other;
                comp = this.action.GetHashCode().CompareTo(mod.action.GetHashCode());
                if (comp != 0x00)
                {
                    return(comp);
                }
                else if (this.reverseAction != null && mod.reverseAction != null)
                {
                    return(this.reverseAction.GetHashCode().CompareTo(mod.reverseAction.GetHashCode()));
                }
            }
            return(0x00);
        }
示例#3
0
 public override int CompareTo(ITimeSensitive other)
 {
     int comp = base.CompareTo (other);
     if (comp != 0x00) {
         return comp;
     } else if (other is ShapeStateModifier) {
         ShapeStateModifier mod = (ShapeStateModifier)other;
         comp = this.action.GetHashCode ().CompareTo (mod.action.GetHashCode ());
         if (comp != 0x00) {
             return comp;
         } else if (this.reverseAction != null && mod.reverseAction != null) {
             return this.reverseAction.GetHashCode ().CompareTo (mod.reverseAction.GetHashCode ());
         }
     }
     return 0x00;
 }
示例#4
0
 public static void AddTimeSensitiveItem(ITimeSensitive item)
 {
     elements.Add(item);
 }
示例#5
0
 /// <summary>
 /// Compares this <see cref="ITimeSensitive"/> instance with the given one.
 /// </summary>
 /// <returns>
 /// A value smaller than zero if this instance will take place before the given one, a value larger than zero if this event
 /// will take place after the given one, zero if both events will be triggered at the same time.
 /// </returns>
 /// <param name='other'>
 /// The <see cref="ITimeSensitive"/> instance to compare with.
 /// </param>
 /// <remarks>
 /// <para>In case the given <see cref="ITimeSensitive"/> is not effective, a negative value is returned.</para>
 /// </remarks>
 public virtual int CompareTo(ITimeSensitive other)
 {
     if (other != null) {
         return this.time.CompareTo (other.Time);
     } else {
         return -0x01;
     }
 }