当前位置: 首页>>代码示例>>C#>>正文


C# Vector2.GetDistanceToChampions方法代码示例

本文整理汇总了C#中System.Vector2.GetDistanceToChampions方法的典型用法代码示例。如果您正苦于以下问题:C# Vector2.GetDistanceToChampions方法的具体用法?C# Vector2.GetDistanceToChampions怎么用?C# Vector2.GetDistanceToChampions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Vector2的用法示例。


在下文中一共展示了Vector2.GetDistanceToChampions方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: InitPositionInfo

        public static PositionInfo InitPositionInfo(Vector2 pos, float extraDelayBuffer, float extraEvadeDistance, Vector2 lastMovePos, Spell lowestEvadeTimeSpell) //clean this shit up
        {
            if (!ObjectCache.myHeroCache.isMoving &&
                 ObjectCache.myHeroCache.serverPos2D.Distance(pos) <= 75)
            {
                pos = ObjectCache.myHeroCache.serverPos2D;
            }

            var extraDist = ObjectCache.menuCache.cache["ExtraCPADistance"].GetValue<Slider>().Value;

            var posInfo = CanHeroWalkToPos(pos, ObjectCache.myHeroCache.moveSpeed, extraDelayBuffer + ObjectCache.gamePing, extraDist);
            posInfo.isDangerousPos = pos.CheckDangerousPos(6);
            posInfo.hasExtraDistance = extraEvadeDistance > 0 ? pos.CheckDangerousPos(extraEvadeDistance) : false;// ? 1 : 0;            
            posInfo.closestDistance = posInfo.distanceToMouse; //GetMovementBlockPositionValue(pos, lastMovePos);
            posInfo.intersectionTime = GetMinCPADistance(pos);
            //GetIntersectDistance(lowestEvadeTimeSpell, ObjectCache.myHeroCache.serverPos2D, pos);               
            //GetClosestDistanceApproach(lowestEvadeTimeSpell, pos, ObjectCache.myHeroCache.moveSpeed, ObjectCache.gamePing, ObjectCache.myHeroCache.serverPos2D, 0);
            posInfo.distanceToMouse = pos.GetPositionValue();
            posInfo.posDistToChamps = pos.GetDistanceToChampions();
            posInfo.speed = ObjectCache.myHeroCache.moveSpeed;

            if (ObjectCache.menuCache.cache["RejectMinDistance"].GetValue<Slider>().Value > 0
            && ObjectCache.menuCache.cache["RejectMinDistance"].GetValue<Slider>().Value >
                posInfo.closestDistance) //reject closestdistance
            {
                posInfo.rejectPosition = true;
            }

            if (ObjectCache.menuCache.cache["MinComfortZone"].GetValue<Slider>().Value >
                posInfo.posDistToChamps)
            {
                posInfo.hasComfortZone = false;
            }

            return posInfo;
        }
开发者ID:aikoy,项目名称:ezEvade,代码行数:36,代码来源:EvadeHelper.cs

示例2: InitPositionInfo

        public static PositionInfo InitPositionInfo(Vector2 pos, float extraDelayBuffer, float extraEvadeDistance, Vector2 lastMovePos, Spell lowestEvadeTimeSpell) //clean this shit up
        {
            if (!GameData.HeroInfo.IsMoving &&
                 GameData.HeroInfo.ServerPos2D.Distance(pos) <= 75)
            {
                pos = GameData.HeroInfo.ServerPos2D;
            }

            var extraDist = ConfigValue.ExtraCpaDistance.GetInt();

            var posInfo = CanHeroWalkToPos(pos, GameData.HeroInfo.MoveSpeed, extraDelayBuffer + Game.Ping, extraDist);
            posInfo.IsDangerousPos = pos.CheckDangerousPos(6);
            posInfo.HasExtraDistance = extraEvadeDistance > 0 ? pos.CheckDangerousPos(extraEvadeDistance) : false;// ? 1 : 0;            
            posInfo.ClosestDistance = posInfo.DistanceToMouse; //GetMovementBlockPositionValue(pos, lastMovePos);
            posInfo.IntersectionTime = GetMinCpaDistance(pos);
            //GetIntersectDistance(lowestEvadeTimeSpell, GameData.HeroInfo.serverPos2D, pos);               
            //GetClosestDistanceApproach(lowestEvadeTimeSpell, pos, GameData.HeroInfo.moveSpeed, Game.Ping, GameData.HeroInfo.serverPos2D, 0);
            posInfo.DistanceToMouse = pos.GetPositionValue();
            posInfo.PosDistToChamps = pos.GetDistanceToChampions();
            posInfo.Speed = GameData.HeroInfo.MoveSpeed;

            if (ConfigValue.RejectMinDistance.GetInt() > 0
                && ConfigValue.RejectMinDistance.GetInt() >
                posInfo.ClosestDistance) //reject closestdistance
            {
                posInfo.RejectPosition = true;
            }

            if (ConfigValue.MinimumComfortZone.GetInt() >
                posInfo.PosDistToChamps)
            {
                posInfo.HasComfortZone = false;
            }

            return posInfo;
        }
开发者ID:coman3,项目名称:EloBuddy.Addons,代码行数:36,代码来源:EvadeHelper.cs

示例3: GetBestPositionDash

        public static PositionInfo GetBestPositionDash(EvadeSpellData spell)
        {
            int posChecked = 0;
            int maxPosToCheck = 100;
            int posRadius = 50;
            int radiusIndex = 0;

            var extraDelayBuffer = ObjectCache.menuCache.cache["ExtraPingBuffer"].Cast<Slider>().CurrentValue;
            var extraEvadeDistance = 100;// Evade.menu.SubMenu("MiscSettings").SubMenu("ExtraBuffers").Item("ExtraEvadeDistance").GetValue<Slider>().Value;
            var extraDist = ObjectCache.menuCache.cache["ExtraCPADistance"].Cast<Slider>().CurrentValue;

            Vector2 heroPoint = ObjectCache.myHeroCache.serverPos2DPing;
            Vector2 lastMovePos = Game.CursorPos.To2D();

            List<PositionInfo> posTable = new List<PositionInfo>();
            List<int> spellList = SpellDetector.GetSpellList();

            int minDistance = 50; //Math.Min(spell.range, minDistance)
            int maxDistance = int.MaxValue;

            if (spell.fixedRange)
            {
                minDistance = maxDistance = (int)spell.range;
            }

            while (posChecked < maxPosToCheck)
            {
                radiusIndex++;

                int curRadius = radiusIndex * (2 * posRadius) + (minDistance - 2 * posRadius);
                int curCircleChecks = (int)Math.Ceiling((2 * Math.PI * (double)curRadius) / (2 * (double)posRadius));

                for (int i = 1; i < curCircleChecks; i++)
                {
                    posChecked++;
                    var cRadians = (2 * Math.PI / (curCircleChecks - 1)) * i; //check decimals
                    var pos = new Vector2((float)Math.Floor(heroPoint.X + curRadius * Math.Cos(cRadians)), (float)Math.Floor(heroPoint.Y + curRadius * Math.Sin(cRadians)));

                    var posInfo = CanHeroWalkToPos(pos, spell.speed, extraDelayBuffer + ObjectCache.gamePing, extraDist);
                    posInfo.isDangerousPos = pos.CheckDangerousPos(6);
                    posInfo.hasExtraDistance = extraEvadeDistance > 0 ? pos.CheckDangerousPos(extraEvadeDistance) : false;// ? 1 : 0;
                    posInfo.distanceToMouse = pos.GetPositionValue();
                    posInfo.spellList = spellList;

                    posInfo.posDistToChamps = pos.GetDistanceToChampions();

                    posTable.Add(posInfo);
                }

                if (curRadius >= maxDistance)
                    break;
            }

            var sortedPosTable =
                posTable.OrderBy(p => p.isDangerousPos)
                        .ThenBy(p => p.posDangerLevel)
                        .ThenBy(p => p.posDangerCount)
                        .ThenBy(p => p.hasExtraDistance)
                        .ThenBy(p => p.distanceToMouse);

            foreach (var posInfo in sortedPosTable)
            {
                if (CheckPathCollision(myHero, posInfo.position) == false)
                {
                    if (PositionInfoStillValid(posInfo, spell.speed))
                    {
                        return posInfo;
                    }
                }
            }

            return null;
        }
开发者ID:CONANLXF,项目名称:AIO,代码行数:73,代码来源:EvadeHelper.cs

示例4: GetBestPositionBlink

        public static PositionInfo GetBestPositionBlink()
        {
            int posChecked = 0;
            int maxPosToCheck = 100;
            int posRadius = 50;
            int radiusIndex = 0;

            var extraEvadeDistance = 100;//Evade.menu.SubMenu("MiscSettings").SubMenu("ExtraBuffers").Item("ExtraAvoidDistance").GetValue<Slider>().Value;

            Vector2 heroPoint = ObjectCache.myHeroCache.serverPos2DPing;
            Vector2 lastMovePos = Game.CursorPos.To2D();

            int minComfortZone = ObjectCache.menuCache.cache["MinComfortZone"].Cast<Slider>().CurrentValue;

            List<PositionInfo> posTable = new List<PositionInfo>();

            while (posChecked < maxPosToCheck)
            {
                radiusIndex++;

                int curRadius = radiusIndex * (2 * posRadius);
                int curCircleChecks = (int)Math.Ceiling((2 * Math.PI * (double)curRadius) / (2 * (double)posRadius));

                for (int i = 1; i < curCircleChecks; i++)
                {
                    posChecked++;
                    var cRadians = (2 * Math.PI / (curCircleChecks - 1)) * i; //check decimals
                    var pos = new Vector2((float)Math.Floor(heroPoint.X + curRadius * Math.Cos(cRadians)), (float)Math.Floor(heroPoint.Y + curRadius * Math.Sin(cRadians)));

                    bool isDangerousPos = pos.CheckDangerousPos(6);
                    var dist = pos.GetPositionValue();

                    var posInfo = new PositionInfo(pos, isDangerousPos, dist);
                    posInfo.hasExtraDistance = extraEvadeDistance > 0 ? pos.CheckDangerousPos(extraEvadeDistance) : false;

                    posInfo.posDistToChamps = pos.GetDistanceToChampions();

                    if (minComfortZone < posInfo.posDistToChamps)
                    {
                        posTable.Add(posInfo);
                    }
                }
            }

            var sortedPosTable =
                posTable.OrderBy(p => p.isDangerousPos)
                        .ThenBy(p => p.hasExtraDistance)
                        .ThenBy(p => p.distanceToMouse);

            foreach (var posInfo in sortedPosTable)
            {
                if (CheckPointCollision(myHero, posInfo.position) == false)
                    return posInfo;
            }

            return null;
        }
开发者ID:CONANLXF,项目名称:AIO,代码行数:57,代码来源:EvadeHelper.cs

示例5: InitPositionInfo

        public static PositionInfo InitPositionInfo(Vector2 pos, float extraDelayBuffer, float extraEvadeDistance, Vector2 lastMovePos, Spell lowestEvadeTimeSpell)
        {
            if (!ObjectCache.myHeroCache.isMoving && ObjectCache.myHeroCache.serverPos2D.LSDistance(pos) <= 75)
                pos = ObjectCache.myHeroCache.serverPos2D;

            var extraDist = ObjectCache.menuCache.cache["ExtraCPADistance"].Cast<Slider>().CurrentValue;

            PositionInfo posInfo;
            posInfo = CanHeroWalkToPos(pos, ObjectCache.myHeroCache.moveSpeed,extraDelayBuffer + ObjectCache.gamePing, extraDist);
            posInfo.isDangerousPos = pos.CheckDangerousPos(6);
            posInfo.hasExtraDistance = extraEvadeDistance > 0 && pos.CheckDangerousPos(extraEvadeDistance);
            posInfo.closestDistance = posInfo.distanceToMouse;
            posInfo.distanceToMouse = pos.GetPositionValue();
            posInfo.posDistToChamps = pos.GetDistanceToChampions();
            posInfo.speed = ObjectCache.myHeroCache.moveSpeed;

            if (ObjectCache.menuCache.cache["RejectMinDistance"].Cast<Slider>().CurrentValue > 0 &&
                ObjectCache.menuCache.cache["RejectMinDistance"].Cast<Slider>().CurrentValue > posInfo.closestDistance) //reject closestdistance
                posInfo.rejectPosition = true;

            if (ObjectCache.menuCache.cache["MinComfortZone"].Cast<Slider>().CurrentValue > posInfo.posDistToChamps)
                posInfo.hasComfortZone = false;

            return posInfo;
        }
开发者ID:CainWolf,项目名称:PortAIO,代码行数:25,代码来源:EvadeHelper.cs

示例6: GetBestPositionBlink

        public static PositionInfo GetBestPositionBlink()
        {
            int posChecked = 0;
            int maxPosToCheck = 100;
            int posRadius = 50;
            int radiusIndex = 0;

            var extraEvadeDistance = ConfigValue.ExtraSpellRadius.GetInt();

            Vector2 heroPoint = GameData.HeroInfo.ServerPos2DPing;
            Vector2 lastMovePos = Game.CursorPos.To2D();

            int minComfortZone = ConfigValue.MinimumComfortZone.GetInt();

            List<PositionInfo> posTable = new List<PositionInfo>();

            while (posChecked < maxPosToCheck)
            {
                radiusIndex++;

                int curRadius = radiusIndex * (2 * posRadius);
                int curCircleChecks = (int)Math.Ceiling((2 * Math.PI * (double)curRadius) / (2 * (double)posRadius));

                for (int i = 1; i < curCircleChecks; i++)
                {
                    posChecked++;
                    var cRadians = (2 * Math.PI / (curCircleChecks - 1)) * i; //check decimals
                    var pos = new Vector2((float)Math.Floor(heroPoint.X + curRadius * Math.Cos(cRadians)), (float)Math.Floor(heroPoint.Y + curRadius * Math.Sin(cRadians)));

                    bool isDangerousPos = pos.CheckDangerousPos(6);
                    var dist = pos.GetPositionValue();

                    var posInfo = new PositionInfo(pos, isDangerousPos, dist);
                    posInfo.HasExtraDistance = extraEvadeDistance > 0 ? pos.CheckDangerousPos(extraEvadeDistance) : false;

                    posInfo.PosDistToChamps = pos.GetDistanceToChampions();

                    if (minComfortZone < posInfo.PosDistToChamps)
                    {
                        posTable.Add(posInfo);
                    }
                }
            }

            var sortedPosTable =
                posTable.OrderBy(p => p.IsDangerousPos)
                        .ThenBy(p => p.HasExtraDistance)
                        .ThenBy(p => p.DistanceToMouse);

            foreach (var posInfo in sortedPosTable)
            {
                if (CheckPointCollision(MyHero, posInfo.Position) == false)
                    return posInfo;
            }

            return null;
        }
开发者ID:coman3,项目名称:EloBuddy.Addons,代码行数:57,代码来源:EvadeHelper.cs


注:本文中的System.Vector2.GetDistanceToChampions方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。