예제 #1
0
파일: Time.cs 프로젝트: Vilder50/SharpCraft
        /// <summary>
        /// Creates a new time object with the specified time
        /// </summary>
        /// <param name="value">the amount of time</param>
        /// <param name="type">the time measuring type</param>
        public Time(T value, ID.TimeType type)
        {
            if (!(typeof(T) == typeof(int) || typeof(T) == typeof(short) || typeof(T) == typeof(long)))
            {
                throw new ArgumentException("Time only supports the types int, short and long");
            }

            Value = value;
            Type  = type;
            _     = GetAsTicks();
        }
예제 #2
0
파일: Time.cs 프로젝트: Vilder50/SharpCraft
 /// <summary>
 /// Creates a new time object with the specified time
 /// </summary>
 /// <param name="value">the amount of time</param>
 /// <param name="type">the time measuring type</param>
 public NoneNegativeTime(T value, ID.TimeType type) : base(value, type)
 {
 }