/**
         * Return time left for the abnormality. Or -1 if no abnormality found
         */
        public long AbnormalityTimeLeft(EntityId target, HotDot.Types dotype)
        {
            if (!_abnormalities.ContainsKey(target))
            {
                return(-1);
            }
            var abnormalityTarget = _abnormalities[target];
            var abnormalities     = abnormalityTarget.Where(t => t.HotDot.Effects.Any(x => x.Type == dotype));

            if (!abnormalities.Any())
            {
                return(-1);
            }
            return(abnormalities.Max(x => x.TimeBeforeEnd));
        }
예제 #2
0
        /**
         * Return time left for the abnormality. Or -1 if no abnormality found
         */
        public long AbnormalityTimeLeft(EntityId target, HotDot.Types dotype)
        {
            if (!_abnormalities.ContainsKey(target))
            {
                return(-1);
            }
            var abnormalityTarget = _abnormalities[target];
            var abnormalities     = abnormalityTarget.Where(t => t.HotDot.Effects.Any(x => x.Type == dotype));
            var enumerable        = abnormalities as IList <Abnormality.Abnormality> ?? abnormalities.ToList();

            if (!enumerable.Any())
            {
                return(-1);
            }
            return(enumerable.Max(x => x.TimeBeforeEnd));
        }