Ensage.Common.UnitDatabase.GetProjectileSpeed C# (CSharp) Метод

GetProjectileSpeed() публичный статический Метод

Returns units projectile speed
public static GetProjectileSpeed ( Hero unit ) : double
unit Hero /// The unit. ///
Результат double
        public static double GetProjectileSpeed(Hero unit)
        {
            if (unit == null || !unit.IsRanged)
            {
                return double.MaxValue;
            }

            var name = unit.StoredName();
            try
            {
                double projSpeed;
                if (!ProjSpeedDictionary.TryGetValue(unit.Handle, out projSpeed))
                {
                    projSpeed = Game.FindKeyValues(name + "/ProjectileSpeed", KeyValueSource.Hero).IntValue;
                }

                return projSpeed;
            }
            catch (KeyValuesNotFoundException)
            {
                if (!Utils.SleepCheck("Ensage.Common.DemoModeWarning"))
                {
                    return double.MaxValue;
                }

                Utils.Sleep(10000, "Ensage.Common.DemoModeWarning");
                Console.WriteLine(@"[[Please do not use demo mode for testing assemblies]]");
                return double.MaxValue;
            }
        }

Same methods

UnitDatabase::GetProjectileSpeed ( Unit unit ) : double