コード例 #1
0
        bool CanGetNextCommand()
        {
            if (Queue.HasNext == false)
            {
                return(false);
            }

            _nextCommand = Queue.Peek();
            return(_nextCommand.NextExecution <= _frameBeginTime);
        }
コード例 #2
0
        /// <summary>
        /// Adds the specified command.
        /// </summary>
        /// <param name="cmd">The command.</param>
        /// <returns></returns>
        public IDeferredCommandHandle Add(DeferredCommand cmd)
        {
            float time             = CrTime.TotalSeconds;
            var   scheduledCommand = new QueuedCommand(this)
            {
                Command       = cmd,
                LastExecution = time,
                NextExecution = time + cmd.InitExecutionDelay
            };

            Queue.Enqueue(scheduledCommand);
            return(scheduledCommand);
        }
コード例 #3
0
 void ResetVariables()
 {
     _nextCommand              = null;
     _extraTimeNeeded          = 0.0f;
     _processedCommandsCounter = 0;
 }