Exemplo n.º 1
0
        public void AddActionInTime(int inTime, System.Action action)
        {
            if (_timer.TimeLeftInSec < inTime)
            {
                throw new ArgumentOutOfRangeException();
            }

            var newItem = new ActionScheduleItem(action, inTime);

            _actions.Add(newItem);
        }
Exemplo n.º 2
0
        public void AddActionAtTime(int atTime, System.Action action)
        {
            if (_timer.TimePassedInSec >= atTime)
            {
                throw new ArgumentOutOfRangeException();
            }

            if (_timer.TimeGeneral < atTime)
            {
                throw new ArgumentOutOfRangeException();
            }

            var newItem = new ActionScheduleItem(action, atTime - _timer.TimePassedInSec);

            _actions.Add(newItem);
        }