Beispiel #1
0
        public IEnumerator <ITask> IncrementTickHandler(IncrementTick incrementTick)
        {
            TickCount count = _state.TickCounts.Find(
                delegate(TickCount test)
            {
                return(test.Name == incrementTick.Body.Name);
            }
                );

            if (count != null)
            {
                count.Count++;
            }
            incrementTick.ResponsePort.Post(DefaultUpdateResponseType.Instance);
            yield break;
        }
Beispiel #2
0
        public IEnumerator <ITask> SetTickCountHandler(SetTickCount setTickCount)
        {
            TickCount count = _state.TickCounts.Find(
                delegate(TickCount test)
            {
                return(test.Name == setTickCount.Body.Name);
            }
                );

            if (count == null)
            {
                _state.TickCounts.Add(setTickCount.Body);
            }
            else
            {
                count.Count = setTickCount.Body.Count;
            }

            setTickCount.ResponsePort.Post(DefaultUpdateResponseType.Instance);
            yield break;
        }