private void HandleVector(MotionVector motionVector)
        {
            var confusionPoints = _rooms[motionVector.End.Uid].GetConfusingPoints(motionVector);

            if (confusionPoints.Count == 0)
            {
                MarkVector(motionVector);
            }
            else if (_rooms[motionVector.Start.Uid].NumberOfPersonsInArea > 0)
            {
                _logger.Info($"{motionVector} [Confused: {string.Join(" | ", confusionPoints)}]");
                _confusedVectors.Add(motionVector.Confuze(confusionPoints));
            }
            // If there is no more people in area this confusion is resolved immediately because it is physically impossible
            else
            {
                _logger.Info($"{motionVector} [Deleted]");
            }
        }
Esempio n. 2
0
        private void HandleVector(MotionVector motionVector)
        {
            var confusionPoints = _rooms[motionVector.End.Uid].GetConfusingPoints(motionVector);

            if (confusionPoints.Count == 0)
            {
                //TODO change this to Async?
                //https://github.com/dotnet/reactive/issues/459
                //https://stackoverflow.com/questions/23006852/howto-call-back-async-function-from-rx-subscribe
                //https://stackoverflow.com/questions/37412129/how-to-subscribe-with-async-method-in-rx
                MarkVector(motionVector).GetAwaiter().GetResult();
            }
            else if (_rooms[motionVector.Start.Uid].NumberOfPersonsInArea > 0)
            {
                Logger.LogInformation($"{motionVector} [Confused: {string.Join(" | ", confusionPoints)}]");
                _confusedVectors.Add(motionVector.Confuze(confusionPoints));
            }
            // If there is no more people in area this confusion is resolved immediately because it is physically impossible
            else
            {
                Logger.LogInformation($"{motionVector} [Deleted]");
            }
        }