コード例 #1
0
        /// <summary>
        ///     Gets the number of remaining milliseconds.
        /// </summary>
        public int GetRemainingMS(LogicTime time)
        {
            int remaining = this._remainingTime - time - this._fastForward;

            if (LogicDataTables.GetGlobals().MoreAccurateTime())
            {
                return(16 * remaining);
            }

            int ms = 1000 * (remaining / 60);

            if (ms % 60 != 0)
            {
                ms += (2133 * ms) >> 7;
            }

            return(ms);
        }
コード例 #2
0
        /// <summary>
        ///     Starts the timer.
        /// </summary>
        public void StartTimer(int totalSecs, LogicTime time, bool setEndTimestamp, int currentTimestamp)
        {
            int totalTicks = 0;

            if (LogicDataTables.GetGlobals().MoreAccurateTime())
            {
                totalTicks = (int)(1000L * totalSecs / 16);
            }
            else
            {
                totalTicks = 60 * totalSecs;
            }

            this._remainingTime = totalTicks + time;

            if (currentTimestamp != -1 && setEndTimestamp)
            {
                this._endTimestamp = currentTimestamp + totalSecs;
            }
        }
コード例 #3
0
        /// <summary>
        ///     Gets the number of remaining seconds.
        /// </summary>
        public int GetRemainingSeconds(LogicTime time)
        {
            int remaining = this._remainingTime - time - this._fastForward;

            if (LogicDataTables.GetGlobals().MoreAccurateTime())
            {
                if (remaining > 0)
                {
                    return(LogicMath.Max((int)(16L * remaining / 1000 + 1), 1));
                }
            }
            else
            {
                if (remaining > 0)
                {
                    return(LogicMath.Max((remaining + 59) / 60, 1));
                }
            }

            return(0);
        }