コード例 #1
0
        public static double GetTurnTime(this Entity unit, Vector3 position)
        {
            var data = UnitDatabase.GetByClassId(unit.ClassID) ?? UnitDatabase.GetByName(unit.Name);

            if (data == null)
            {
                return
                    (Math.Max(
                         Math.Abs(FindAngleR(unit) - Utils.DegreeToRadian(unit.FindAngleBetween(position))) - 0.69,
                         0) / (0.5 * (1 / 0.03)));
            }
            var turnRate = data.TurnRate;

            return(Math.Max(
                       Math.Abs(FindAngleR(unit) - Utils.DegreeToRadian(unit.FindAngleBetween(position))) - 0.69,
                       0) / (turnRate * (1 / 0.03)));
        }