示例#1
0
 internal void Reset()
 {
     _summonsQueue.Clear();
     _decisionQueue.Clear();
     _currentSummons  = null;
     _currentDecision = null;
 }
示例#2
0
        internal void Work()
        {
            WorkType   = Board.WorkTypes.Nothing;
            OutputType = Board.OutputTypes.Nothing;
            Output     = null;

            if (_currentDecision == null && _decisionQueue.Count > 0)
            {
                _currentDecision = _decisionQueue.Dequeue();
            }
            if (_currentSummons == null && _summonsQueue.Count > 0)
            {
                _currentSummons = _summonsQueue.Dequeue();
            }

            if (_currentDecision != null)
            {
                WorkType = Board.WorkTypes.Decision;
                _currentDecision.DoWork();
                if (_currentDecision.WorkHours == _decisionHours)
                {
                    OutputType       = Board.OutputTypes.Decision;
                    Output           = _currentDecision.Copy();
                    _currentDecision = null;
                }
            }
            else if (_currentSummons != null)
            {
                WorkType = Board.WorkTypes.Summons;
                _currentSummons.DoWork();
                if (_currentSummons.WorkHours == _summonsHours)
                {
                    OutputType      = Board.OutputTypes.Summons;
                    Output          = _currentSummons.Copy();
                    _currentSummons = null;
                }
            }
        }
示例#3
0
 internal void EnqueueSummons(Summons s, uint hour)
 {
     s.Reset();
     _summonsQueue.Enqueue(s, hour);
 }