Ejemplo n.º 1
0
        public static List <Vector2> GetEnemyPoints()
        {
            var polygonsList = EnemiesClose.Select(enemy => new Geometry.Circle(enemy.ServerPosition.ToVector2(), (enemy.IsMelee ? enemy.AttackRange * 1.5f : enemy.AttackRange) + enemy.BoundingRadius + 20).ToPolygon()).ToList();
            var pathList     = Geometry.ClipPolygons(polygonsList);
            var pointList    = pathList.SelectMany(path => path, (path, point) => new Vector2(point.X, point.Y)).Where(currentPoint => !currentPoint.IsWall()).ToList();

            return(pointList);
        }
Ejemplo n.º 2
0
        private static List <Vector2> GetEnemyPoints(bool dynamic = true)
        {
            var staticRange  = 360f;
            var polygonsList = EnemiesClose.Select(enemy => new Geometry.Polygon.Circle(enemy.ServerPosition.To2D(), (dynamic ? (enemy.IsMelee ? enemy.AttackRange * 1.5f : enemy.AttackRange) : staticRange) + enemy.BoundingRadius + 20)).ToList();
            var pathList     = Geometry.ClipPolygons(polygonsList);
            var pointList    = pathList.SelectMany(path => path, (path, point) => new Vector2(point.X, point.Y)).Where(currentPoint => !currentPoint.IsWall()).ToList();

            return(pointList);
        }