Search Results for

    Show / Hide Table of Contents

    Class Extensions

    Enumerable Extensions.

    Inheritance
    System.Object
    Extensions
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Oasys.Common.Extensions
    Assembly: Oasys.Common.dll
    Syntax
    public static class Extensions

    Methods

    AngleBetween(Vector2, Vector2)

    Returns the angle between two vectors.

    Declaration
    public static float AngleBetween(this Vector2 vector2, Vector2 toVector2)
    Parameters
    Type Name Description
    SharpDX.Vector2 vector2

    Extended SharpDX Vector2

    SharpDX.Vector2 toVector2

    SharpDX Vector2

    Returns
    Type Description
    System.Single

    Angle between two vectors in float-units

    AngleBetween(Vector2, Vector3)

    Returns the angle between two vectors.

    Declaration
    public static float AngleBetween(this Vector2 vector2, Vector3 toVector3)
    Parameters
    Type Name Description
    SharpDX.Vector2 vector2

    Extended SharpDX Vector2

    SharpDX.Vector3 toVector3

    SharpDX Vector3

    Returns
    Type Description
    System.Single

    Angle between two vectors in float-units

    AngleBetween(Vector3, Vector2)

    Returns the angle between two vectors.

    Declaration
    public static float AngleBetween(this Vector3 vector3, Vector2 toVector2)
    Parameters
    Type Name Description
    SharpDX.Vector3 vector3

    Extended SharpDX Vector3

    SharpDX.Vector2 toVector2

    SharpDX Vector2

    Returns
    Type Description
    System.Single

    Angle between two vectors in float-units

    AngleBetween(Vector3, Vector3)

    Returns the angle between two vectors.

    Declaration
    public static float AngleBetween(this Vector3 vector3, Vector3 toVector3)
    Parameters
    Type Name Description
    SharpDX.Vector3 vector3

    Extended SharpDX Vector3

    SharpDX.Vector3 toVector3

    SharpDX Vector3

    Returns
    Type Description
    System.Single

    Angle between two vectors in float-units

    CircleCircleIntersection(Vector2, Vector2, Single, Single)

    Returns the two intersection points between two circles.

    Declaration
    public static Vector2[] CircleCircleIntersection(this Vector2 center1, Vector2 center2, float radius1, float radius2)
    Parameters
    Type Name Description
    SharpDX.Vector2 center1

    Center of Circle 1

    SharpDX.Vector2 center2

    Center of Circle 2

    System.Single radius1

    Circle 1 Radius

    System.Single radius2

    Circle 2 Radius

    Returns
    Type Description
    SharpDX.Vector2[]

    Array of SharpDX.Vector2 that contains the intersection points.

    ClearFlags<T>(T, T)

    Clears all given flags from a specific struct source.

    Declaration
    public static T ClearFlags<T>(this T value, T flags)
        where T : struct
    Parameters
    Type Name Description
    T value

    The enumeration

    T flags

    Flags to be cleared

    Returns
    Type Description
    T

    Enumeration with Flag Attributes (struct)

    Type Parameters
    Name Description
    T

    Flag with Attributes type.

    Closest(Vector2, IEnumerable<Vector2>)

    Seeks for the closest Vector2 to the extended Vector2.

    Declaration
    public static Vector2 Closest(this Vector2 vector2, IEnumerable<Vector2> array)
    Parameters
    Type Name Description
    SharpDX.Vector2 vector2

    Extended SharpDX Vector2

    System.Collections.Generic.IEnumerable<SharpDX.Vector2> array

    Vector2 Collection

    Returns
    Type Description
    SharpDX.Vector2

    Closest Vector2

    Closest(Vector2, IEnumerable<Vector3>)

    Seeks for the closest Vector3 to the extended Vector2.

    Declaration
    public static Vector3 Closest(this Vector2 vector2, IEnumerable<Vector3> array)
    Parameters
    Type Name Description
    SharpDX.Vector2 vector2

    Extended SharpDX Vector2

    System.Collections.Generic.IEnumerable<SharpDX.Vector3> array

    Vector3 Collection

    Returns
    Type Description
    SharpDX.Vector3

    Closest Vector3

    Closest(Vector3, IEnumerable<Vector2>)

    Seeks for the closest Vector2 to the extended Vector3.

    Declaration
    public static Vector2 Closest(this Vector3 vector3, IEnumerable<Vector2> array)
    Parameters
    Type Name Description
    SharpDX.Vector3 vector3

    Extended SharpDX Vector3

    System.Collections.Generic.IEnumerable<SharpDX.Vector2> array

    Vector2 Collection

    Returns
    Type Description
    SharpDX.Vector2

    Closest Vector2

    Closest(Vector3, IEnumerable<Vector3>)

    Seeks for the closest Vector3 to the extended Vector3.

    Declaration
    public static Vector3 Closest(this Vector3 vector3, IEnumerable<Vector3> array)
    Parameters
    Type Name Description
    SharpDX.Vector3 vector3

    Extended SharpDX Vector3

    System.Collections.Generic.IEnumerable<SharpDX.Vector3> array

    Vector3 Collection

    Returns
    Type Description
    SharpDX.Vector3

    Closest Vector3

    CombineFlags<T>(IEnumerable<T>)

    Combines flags from an enumerable list to a new given struct source.

    Declaration
    public static T CombineFlags<T>(this IEnumerable<T> flags)
        where T : struct
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<T> flags

    The flags

    Returns
    Type Description
    T

    Enumeration with Flag Attributes (struct)

    Type Parameters
    Name Description
    T

    Flag with Attributes type.

    CrossProduct(Vector2, Vector2)

    Returns the cross product Z value.

    Declaration
    public static float CrossProduct(this Vector2 self, Vector2 other)
    Parameters
    Type Name Description
    SharpDX.Vector2 self

    The self Vector2.

    SharpDX.Vector2 other

    The other Vector2.

    Returns
    Type Description
    System.Single

    The System.Single cross product.

    CutPath(List<Vector2>, Single)

    Declaration
    public static List<Vector2> CutPath(this List<Vector2> path, float distance)
    Parameters
    Type Name Description
    System.Collections.Generic.List<SharpDX.Vector2> path
    System.Single distance
    Returns
    Type Description
    System.Collections.Generic.List<SharpDX.Vector2>

    Distance(GameObjectBase, GameObjectBase)

    Gets the distance between two GameObjects

    Declaration
    public static float Distance(this GameObjectBase source, GameObjectBase target)
    Parameters
    Type Name Description
    GameObjectBase source

    The Source

    GameObjectBase target

    The Target

    Returns
    Type Description
    System.Single

    The distance between the two objects

    Distance(GameObjectBase, Vector2)

    Gets the distance between a Oasys.Common.GameObject and a SharpDX.Vector2

    Declaration
    public static float Distance(this GameObjectBase source, Vector2 position)
    Parameters
    Type Name Description
    GameObjectBase source

    The Source

    SharpDX.Vector2 position

    The Position

    Returns
    Type Description
    System.Single

    The distance between a Oasys.Common.GameObject and a SharpDX.Vector2

    Distance(GameObjectBase, Vector3)

    Gets the distance between a Oasys.Common.GameObject and a SharpDX.Vector3

    Declaration
    public static float Distance(this GameObjectBase source, Vector3 position)
    Parameters
    Type Name Description
    GameObjectBase source

    The Source

    SharpDX.Vector3 position

    The Position

    Returns
    Type Description
    System.Single

    The distance between a Oasys.Common.GameObject and a SharpDX.Vector3

    Distance(Vector2, Vector2)

    Calculates the distance between the extended Vector2 and a Vector2.

    Declaration
    public static float Distance(this Vector2 vector2, Vector2 toVector2)
    Parameters
    Type Name Description
    SharpDX.Vector2 vector2

    SharpDX Vector2 (From)

    SharpDX.Vector2 toVector2

    SharpDX Vector2 (To)

    Returns
    Type Description
    System.Single

    Float Units

    Distance(Vector2, Vector2, Vector2, Boolean)

    Returns the distance to the line segment.

    Declaration
    public static float Distance(this Vector2 point, Vector2 segmentStart, Vector2 segmentEnd, bool onlyIfOnSegment = false)
    Parameters
    Type Name Description
    SharpDX.Vector2 point

    Extended SharpDX Vector2

    SharpDX.Vector2 segmentStart

    Vector2 Segment Start

    SharpDX.Vector2 segmentEnd

    Vector2 Segment End

    System.Boolean onlyIfOnSegment

    Only if Segment

    Returns
    Type Description
    System.Single

    The distance between the point and the segment.

    Distance(Vector2, Vector3)

    Calculates the distance between the extended Vector2 and a Vector3.

    Declaration
    public static float Distance(this Vector2 vector2, Vector3 toVector3)
    Parameters
    Type Name Description
    SharpDX.Vector2 vector2

    SharpDX Vector2 (From)

    SharpDX.Vector3 toVector3

    SharpDX Vector3 (To)

    Returns
    Type Description
    System.Single

    Float Units

    Distance(Vector3, Vector2)

    Calculates the distance between the extended Vector3 and a Vector3.

    Declaration
    public static float Distance(this Vector3 vector3, Vector2 toVector2)
    Parameters
    Type Name Description
    SharpDX.Vector3 vector3

    SharpDX Vector3 (From)

    SharpDX.Vector2 toVector2

    SharpDX Vector2 (To)

    Returns
    Type Description
    System.Single

    Float Units

    Distance(Vector3, Vector3)

    Calculates the distance between the extended Vector3 and a Vector3.

    Declaration
    public static float Distance(this Vector3 vector3, Vector3 toVector3)
    Parameters
    Type Name Description
    SharpDX.Vector3 vector3

    SharpDX Vector3 (From)

    SharpDX.Vector3 toVector3

    SharpDX Vector3 (To)

    Returns
    Type Description
    System.Single

    Float Units

    DistanceSquared(GameObjectBase, GameObjectBase)

    Gets the distance squared between two GameObjects

    Declaration
    public static float DistanceSquared(this GameObjectBase source, GameObjectBase target)
    Parameters
    Type Name Description
    GameObjectBase source

    The Source

    GameObjectBase target

    The Target

    Returns
    Type Description
    System.Single

    The squared distance between the two objects

    DistanceSquared(GameObjectBase, Vector2)

    Gets the distance squared between a Oasys.Common.GameObject and a SharpDX.Vector2

    Declaration
    public static float DistanceSquared(this GameObjectBase source, Vector2 position)
    Parameters
    Type Name Description
    GameObjectBase source

    The Source

    SharpDX.Vector2 position

    The Position

    Returns
    Type Description
    System.Single

    The distance squared between a Oasys.Common.GameObject and a SharpDX.Vector2

    DistanceSquared(GameObjectBase, Vector3)

    Gets the distance squared between a Oasys.Common.GameObject and a SharpDX.Vector3

    Declaration
    public static float DistanceSquared(this GameObjectBase source, Vector3 position)
    Parameters
    Type Name Description
    GameObjectBase source

    The Source

    SharpDX.Vector3 position

    The Position

    Returns
    Type Description
    System.Single

    The distance squared between a Oasys.Common.GameObject and a SharpDX.Vector3

    DistanceSquared(Vector2, Vector2)

    Calculates the squared distance between two vectors.

    Declaration
    public static float DistanceSquared(this Vector2 vector2, Vector2 toVector2)
    Parameters
    Type Name Description
    SharpDX.Vector2 vector2

    Extended SharpDX Vector2

    SharpDX.Vector2 toVector2

    SharpDX Vector2

    Returns
    Type Description
    System.Single

    The squared distance between the two vectors.

    DistanceSquared(Vector2, Vector2, Vector2, Boolean)

    Returns the squared distance to the line segment.

    Declaration
    public static float DistanceSquared(this Vector2 point, Vector2 segmentStart, Vector2 segmentEnd, bool onlyIfOnSegment = false)
    Parameters
    Type Name Description
    SharpDX.Vector2 point

    Extended SharpDX Vector2

    SharpDX.Vector2 segmentStart

    Vector2 Segment Start

    SharpDX.Vector2 segmentEnd

    Vector2 Segment End

    System.Boolean onlyIfOnSegment

    Only if Segment

    Returns
    Type Description
    System.Single

    The squared distance between the point and the segment.

    DistanceSquared(Vector2, Vector3)

    Calculates the squared distance between two vectors.

    Declaration
    public static float DistanceSquared(this Vector2 vector2, Vector3 toVector3)
    Parameters
    Type Name Description
    SharpDX.Vector2 vector2

    Extended SharpDX Vector2

    SharpDX.Vector3 toVector3

    SharpDX Vector3

    Returns
    Type Description
    System.Single

    The squared distance between the two vectors.

    DistanceSquared(Vector3, Vector2)

    Calculates the squared distance between two vectors.

    Declaration
    public static float DistanceSquared(this Vector3 vector3, Vector2 toVector2)
    Parameters
    Type Name Description
    SharpDX.Vector3 vector3

    Extended SharpDX Vector3

    SharpDX.Vector2 toVector2

    SharpDX Vector2

    Returns
    Type Description
    System.Single

    The squared distance between the two vectors.

    DistanceSquared(Vector3, Vector3)

    Calculates the squared distance between two vectors.

    Declaration
    public static float DistanceSquared(this Vector3 vector3, Vector3 toVector3)
    Parameters
    Type Name Description
    SharpDX.Vector3 vector3

    Extended SharpDX Vector3

    SharpDX.Vector3 toVector3

    SharpDX Vector3

    Returns
    Type Description
    System.Single

    The squared distance between the two vectors.

    DistanceToPlayer(GameObjectBase)

    Gets the distance between Obj_AI_Base source and Player

    Declaration
    public static float DistanceToPlayer(this GameObjectBase source)
    Parameters
    Type Name Description
    GameObjectBase source

    The Source

    Returns
    Type Description
    System.Single

    The distance between a and the Player

    DistanceToPlayer(Vector2)

    Gets the distance between the point and the Player

    Declaration
    public static float DistanceToPlayer(this Vector2 position)
    Parameters
    Type Name Description
    SharpDX.Vector2 position

    The Position

    Returns
    Type Description
    System.Single

    The distance between the position and the Player

    DistanceToPlayer(Vector3)

    Gets the distance between the point and the Player

    Declaration
    public static float DistanceToPlayer(this Vector3 position)
    Parameters
    Type Name Description
    SharpDX.Vector3 position

    The Position

    Returns
    Type Description
    System.Single

    The distance between the position and the Player

    Extend(Vector2, GameObjectBase, Single)

    Returns a position that runs from the source position to the targets position with the length of the range specified.

    Declaration
    public static Vector2 Extend(this Vector2 source, GameObjectBase target, float range)
    Parameters
    Type Name Description
    SharpDX.Vector2 source
    GameObjectBase target
    System.Single range
    Returns
    Type Description
    SharpDX.Vector2

    Extend(Vector2, Vector2, Single)

    Extends a Vector2 to another Vector2.

    Declaration
    public static Vector2 Extend(this Vector2 vector2, Vector2 toVector2, float distance)
    Parameters
    Type Name Description
    SharpDX.Vector2 vector2

    Extended SharpDX Vector2 (From)

    SharpDX.Vector2 toVector2

    SharpDX Vector2 (To)

    System.Single distance

    Distance (float units)

    Returns
    Type Description
    SharpDX.Vector2

    Extended Vector2

    Extend(Vector2, Vector3, Single)

    Extends a Vector2 to a Vector3.

    Declaration
    public static Vector2 Extend(this Vector2 vector2, Vector3 toVector3, float distance)
    Parameters
    Type Name Description
    SharpDX.Vector2 vector2

    Extended SharpDX Vector2 (From)

    SharpDX.Vector3 toVector3

    SharpDX Vector3 (To)

    System.Single distance

    Distance (float units)

    Returns
    Type Description
    SharpDX.Vector2

    Extended Vector2

    Extend(Vector3, GameObjectBase, Single)

    Returns a position that runs from the source position to the targets position with the length of the range specified.

    Declaration
    public static Vector2 Extend(this Vector3 source, GameObjectBase target, float range)
    Parameters
    Type Name Description
    SharpDX.Vector3 source
    GameObjectBase target
    System.Single range
    Returns
    Type Description
    SharpDX.Vector2

    Extend(Vector3, Vector2, Single)

    Extends a Vector3 to a Vector2.

    Declaration
    public static Vector3 Extend(this Vector3 vector3, Vector2 toVector2, float distance)
    Parameters
    Type Name Description
    SharpDX.Vector3 vector3

    Extended SharpDX Vector3 (From)

    SharpDX.Vector2 toVector2

    SharpDX Vector2 (To)

    System.Single distance

    Distance (float units)

    Returns
    Type Description
    SharpDX.Vector3

    Extended Vector3

    Extend(Vector3, Vector3, Single)

    Extends a Vector3 to another Vector3.

    Declaration
    public static Vector3 Extend(this Vector3 vector3, Vector3 toVector3, float distance)
    Parameters
    Type Name Description
    SharpDX.Vector3 vector3

    Extended SharpDX Vector3 (From)

    SharpDX.Vector3 toVector3

    SharpDX Vector3 (To)

    System.Single distance

    Distance (float units)

    Returns
    Type Description
    SharpDX.Vector3

    Extended Vector3

    Find<TSource>(IEnumerable<TSource>, Predicate<TSource>)

    Finds match in a container of values.

    Declaration
    public static TSource Find<TSource>(this IEnumerable<TSource> source, Predicate<TSource> match)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<TSource> source

    List of all the values

    System.Predicate<TSource> match

    Method that determines whether the specified object meets the criteria

    Returns
    Type Description
    TSource

    Matches based on the predicate

    Type Parameters
    Name Description
    TSource

    Given source

    ForEach<T>(IEnumerable<T>, Action<T>)

    Does an action over a list of types.

    Declaration
    public static void ForEach<T>(this IEnumerable<T> list, Action<T> action)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<T> list

    List of values

    System.Action<T> action

    Function to call foreach value

    Type Parameters
    Name Description
    T

    Type of value

    GetCombinations(IReadOnlyCollection<Vector2>)

    Returns all the subgroup combinations that can be made from a group

    Declaration
    public static IEnumerable<List<Vector2>> GetCombinations(this IReadOnlyCollection<Vector2> allValues)
    Parameters
    Type Name Description
    System.Collections.Generic.IReadOnlyCollection<SharpDX.Vector2> allValues

    List of SharpDX.Vector2

    Returns
    Type Description
    System.Collections.Generic.IEnumerable<System.Collections.Generic.List<SharpDX.Vector2>>

    Double list of vectors.

    GetFlagDescription<T>(T)

    Gets a flag attribute description.

    Declaration
    public static string GetFlagDescription<T>(this T value)
        where T : struct
    Parameters
    Type Name Description
    T value

    The enumeration

    Returns
    Type Description
    System.String

    Enumeration with Flag Attributes (struct)

    Type Parameters
    Name Description
    T

    Flag with Attributes type.

    GetFlags<T>(T)

    Retrieves all of the flags from a specific struct source.

    Declaration
    public static IEnumerable<T> GetFlags<T>(this T value)
        where T : struct
    Parameters
    Type Name Description
    T value

    The enumeration

    Returns
    Type Description
    System.Collections.Generic.IEnumerable<T>

    Enumeration with Flag Attributes (struct)

    Type Parameters
    Name Description
    T

    Flag with Attributes type.

    GetPathLength(List<Vector2>)

    Gets the total distance of a list of vectors.

    Declaration
    public static float GetPathLength(this List<Vector2> path)
    Parameters
    Type Name Description
    System.Collections.Generic.List<SharpDX.Vector2> path

    The path

    Returns
    Type Description
    System.Single

    Total distance of the path

    GetPathLength(List<Vector3>)

    Gets the total distance of a list of vectors.

    Declaration
    public static float GetPathLength(this List<Vector3> path)
    Parameters
    Type Name Description
    System.Collections.Generic.List<SharpDX.Vector3> path

    The path

    Returns
    Type Description
    System.Single

    Total distance of the path

    GetRecallTime(AIHeroClient)

    Returns the recall time duration for a specified AIHeroClient

    Declaration
    public static int GetRecallTime(this AIHeroClient hero)
    Parameters
    Type Name Description
    AIHeroClient hero

    The Hero

    Returns
    Type Description
    System.Int32

    Recall Time Duration

    GetRecallTime(String)

    Returns the recall time duration for a specific recall type by name.

    Declaration
    public static int GetRecallTime(string recallName)
    Parameters
    Type Name Description
    System.String recallName

    Recall type name

    Returns
    Type Description
    System.Int32

    Recall Time Duration

    GetTurretType(Turret)

    Gets the turret tier type.

    Declaration
    public static TurretType GetTurretType(this Turret turret)
    Parameters
    Type Name Description
    Turret turret

    The turret.

    Returns
    Type Description
    TurretType

    The TurretType.

    GetWaypoints(GameObjectBase)

    Declaration
    public static List<Vector2> GetWaypoints(this GameObjectBase unit)
    Parameters
    Type Name Description
    GameObjectBase unit
    Returns
    Type Description
    System.Collections.Generic.List<SharpDX.Vector2>

    In<T>(T, T[])

    Determines if a list contains any of the values.

    Declaration
    public static bool In<T>(this T source, params T[] list)
    Parameters
    Type Name Description
    T source

    Container of objects

    T[] list

    Any object that should be in the container

    Returns
    Type Description
    System.Boolean

    If the container contains any values.

    Type Parameters
    Name Description
    T

    Type of object to look for

    Intersection(Vector2, Vector2, Vector2, Vector2)

    Intersects two line segments.

    Declaration
    public static IntersectionResult Intersection(this Vector2 lineSegment1Start, Vector2 lineSegment1End, Vector2 lineSegment2Start, Vector2 lineSegment2End)
    Parameters
    Type Name Description
    SharpDX.Vector2 lineSegment1Start

    Line Segment 1 (Start)

    SharpDX.Vector2 lineSegment1End

    Line Segment 1 (End)

    SharpDX.Vector2 lineSegment2Start

    Line Segment 2 (Start)>

    SharpDX.Vector2 lineSegment2End

    Line Segment 2 (End)

    Returns
    Type Description
    IntersectionResult

    The intersection result, IntersectionResult

    IsBothFacing(GameObjectBase, GameObjectBase)

    Calculates if the source and the target are facing each-other.

    Declaration
    public static bool IsBothFacing(this GameObjectBase source, GameObjectBase target)
    Parameters
    Type Name Description
    GameObjectBase source

    Extended source

    GameObjectBase target

    The Target

    Returns
    Type Description
    System.Boolean

    Returns if the source and target are facing each-other (boolean)

    IsFacing(GameObjectBase, GameObjectBase)

    Calculates if the source is facing the target.

    Declaration
    public static bool IsFacing(this GameObjectBase source, GameObjectBase target)
    Parameters
    Type Name Description
    GameObjectBase source

    Extended source

    GameObjectBase target

    The Target

    Returns
    Type Description
    System.Boolean

    Returns if the source is facing the target (boolean)

    IsMelee(GameObjectBase)

    Return whether the specific unit is melee

    Declaration
    public static bool IsMelee(this GameObjectBase unit)
    Parameters
    Type Name Description
    GameObjectBase unit

    Extended unit

    Returns
    Type Description
    System.Boolean

    Returns if the unit is melee

    IsOnScreen(Vector2, Single)

    Declaration
    public static bool IsOnScreen(this Vector2 vector2, float radius = 0F)
    Parameters
    Type Name Description
    SharpDX.Vector2 vector2
    System.Single radius
    Returns
    Type Description
    System.Boolean

    IsOnScreen(Vector3, Single)

    Declaration
    public static bool IsOnScreen(this Vector3 vector3, float radius = 0F)
    Parameters
    Type Name Description
    SharpDX.Vector3 vector3
    System.Single radius
    Returns
    Type Description
    System.Boolean

    IsOrthogonal(Vector2, Vector2)

    Returns if the angle is orthogonal.

    Declaration
    public static bool IsOrthogonal(this Vector2 vector2, Vector2 toVector2)
    Parameters
    Type Name Description
    SharpDX.Vector2 vector2

    Extended SharpDX Vector2

    SharpDX.Vector2 toVector2

    SharpDX Vector2

    Returns
    Type Description
    System.Boolean

    The System.Boolean.

    IsOrthogonal(Vector2, Vector3)

    Returns if the angle is orthogonal.

    Declaration
    public static bool IsOrthogonal(this Vector2 vector2, Vector3 toVector3)
    Parameters
    Type Name Description
    SharpDX.Vector2 vector2

    Extended SharpDX Vector2

    SharpDX.Vector3 toVector3

    SharpDX Vector3

    Returns
    Type Description
    System.Boolean

    The System.Boolean.

    IsOrthogonal(Vector3, Vector2)

    Returns if the angle is orthogonal.

    Declaration
    public static bool IsOrthogonal(Vector3 vector3, Vector2 toVector2)
    Parameters
    Type Name Description
    SharpDX.Vector3 vector3

    Extended SharpDX Vector3

    SharpDX.Vector2 toVector2

    SharpDX Vector2

    Returns
    Type Description
    System.Boolean

    Returns if the angle is orthogonal

    IsOrthogonal(Vector3, Vector3)

    Returns if the angle is orthogonal.

    Declaration
    public static bool IsOrthogonal(Vector3 vector3, Vector3 toVector3)
    Parameters
    Type Name Description
    SharpDX.Vector3 vector3

    Extended SharpDX Vector3

    SharpDX.Vector3 toVector3

    SharpDX Vector3

    Returns
    Type Description
    System.Boolean

    Returns if the angle is orthogonal

    IsRecalling(AIHeroClient)

    Returns if the unit is recalling.

    Declaration
    public static bool IsRecalling(this AIHeroClient unit)
    Parameters
    Type Name Description
    AIHeroClient unit

    Extended unit

    Returns
    Type Description
    System.Boolean

    Returns if the unit is recalling (boolean)

    IsUnderRectangle(Vector2, Single, Single, Single, Single)

    Returns true if the point is under the rectangle

    Declaration
    public static bool IsUnderRectangle(this Vector2 point, float x, float y, float width, float height)
    Parameters
    Type Name Description
    SharpDX.Vector2 point

    Extended SharpDX Vector2

    System.Single x

    Rectangle X-axis

    System.Single y

    Rectangle Y-axis

    System.Single width

    Rectangle width

    System.Single height

    Rectangle height

    Returns
    Type Description
    System.Boolean

    The System.Boolean.

    IsValid(Vector2)

    Checks for if the extended Vector2 is valid.

    Declaration
    public static bool IsValid(this Vector2 vector2)
    Parameters
    Type Name Description
    SharpDX.Vector2 vector2

    SharpDX Vector2

    Returns
    Type Description
    System.Boolean

    The System.Boolean.

    IsValid(Vector3)

    Checks for if the extended Vector3 is valid.

    Declaration
    public static bool IsValid(this Vector3 vector3)
    Parameters
    Type Name Description
    SharpDX.Vector3 vector3

    SharpDX Vector3

    Returns
    Type Description
    System.Boolean

    The System.Boolean.

    IsValidTarget(GameObjectBase, Single, Boolean, Vector3)

    Checks if the target unit is valid.

    Declaration
    public static bool IsValidTarget(this GameObjectBase unit, float range = 3.40282347E+38F, bool checkTeam = true, Vector3 from = default(Vector3))
    Parameters
    Type Name Description
    GameObjectBase unit

    The Unit

    System.Single range

    The Range

    System.Boolean checkTeam

    Checks if the target is an enemy from the Player's side

    SharpDX.Vector3 from

    Check From

    Returns
    Type Description
    System.Boolean

    The System.Boolean.

    Log(Exception)

    Logs an exception to the console and a file.

    Declaration
    public static void Log(this Exception exception)
    Parameters
    Type Name Description
    System.Exception exception

    Exception to log.

    Magnitude(Vector2)

    Returns the calculated magnitude of the given Vector2.

    Declaration
    public static float Magnitude(this Vector2 vector2)
    Parameters
    Type Name Description
    SharpDX.Vector2 vector2

    Extended SharpDX Vector2

    Returns
    Type Description
    System.Single

    Magnitude in float-units

    Magnitude(Vector3)

    Returns the calculated magnitude of the given Vector3.

    Declaration
    public static float Magnitude(this Vector3 vector3)
    Parameters
    Type Name Description
    SharpDX.Vector3 vector3

    Extended SharpDX Vector3

    Returns
    Type Description
    System.Single

    Magnitude in float-units

    MaxOrDefault<T, TR>(IEnumerable<T>, Func<T, TR>)

    Gets the maximum value of an IEnumerable by the comparer, or returns the default.

    Declaration
    public static T MaxOrDefault<T, TR>(this IEnumerable<T> container, Func<T, TR> comparer)
        where TR : IComparable
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<T> container

    Container of values to search through

    System.Func<T, TR> comparer

    Function to compare values

    Returns
    Type Description
    T

    The maximums of the objects

    Type Parameters
    Name Description
    T

    Type of object

    TR

    Type result of comparer

    MinOrDefault<T, TR>(IEnumerable<T>, Func<T, TR>)

    Gets the minimum value of an IEnumerable by the comparer, or returns the default.

    Declaration
    public static T MinOrDefault<T, TR>(this IEnumerable<T> container, Func<T, TR> comparer)
        where TR : IComparable
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<T> container

    Container of values to search through

    System.Func<T, TR> comparer

    Function to compare the values

    Returns
    Type Description
    T

    The minimum of the objects

    Type Parameters
    Name Description
    T

    Type of object

    TR

    Type result of comparer

    Normalized(Vector2)

    Normalizes a Vector2.

    Declaration
    public static Vector2 Normalized(this Vector2 vector2)
    Parameters
    Type Name Description
    SharpDX.Vector2 vector2

    SharpDX Vector2

    Returns
    Type Description
    SharpDX.Vector2

    Normalized Vector2

    Normalized(Vector3)

    Normalizes a Vector3.

    Declaration
    public static Vector3 Normalized(this Vector3 vector3)
    Parameters
    Type Name Description
    SharpDX.Vector3 vector3

    SharpDX Vector3

    Returns
    Type Description
    SharpDX.Vector3

    Normalized Vector3

    PathLength(List<Vector2>)

    Returns the total distance of a path.

    Declaration
    public static float PathLength(this List<Vector2> path)
    Parameters
    Type Name Description
    System.Collections.Generic.List<SharpDX.Vector2> path

    The path.

    Returns
    Type Description
    System.Single

    The System.Single.

    PathLength(List<Vector3>)

    Returns the total distance of a path.

    Declaration
    public static float PathLength(this List<Vector3> path)
    Parameters
    Type Name Description
    System.Collections.Generic.List<SharpDX.Vector3> path

    The path.

    Returns
    Type Description
    System.Single

    The System.Single.

    Perpendicular(Vector2, Int32)

    Returns the Perpendicular Vector2 to the Extended Vector2.

    Declaration
    public static Vector2 Perpendicular(this Vector2 vector2, int offset = 0)
    Parameters
    Type Name Description
    SharpDX.Vector2 vector2

    Extended SharpDX Vector2

    System.Int32 offset

    Axis Offset (0 = X, 1 = Y)

    Returns
    Type Description
    SharpDX.Vector2

    Perpendicular Vector2

    Perpendicular(Vector3, Int32)

    Returns the Perpendicular Vector3 to the Extended Vector3.

    Declaration
    public static Vector3 Perpendicular(this Vector3 vector3, int offset = 0)
    Parameters
    Type Name Description
    SharpDX.Vector3 vector3

    Extended SharpDX Vector3

    System.Int32 offset

    Axis Offset (0 = X, 1 = Y)

    Returns
    Type Description
    SharpDX.Vector3

    Perpendicular Vector3

    Polar(Vector2)

    Returns the polar for vector angle (in Degrees).

    Declaration
    public static float Polar(this Vector2 vector2)
    Parameters
    Type Name Description
    SharpDX.Vector2 vector2

    Extended SharpDX Vector2

    Returns
    Type Description
    System.Single

    Polar for Vector Angle (Degrees)

    Polar(Vector3)

    Returns the polar for vector angle (in Degrees).

    Declaration
    public static float Polar(this Vector3 vector3)
    Parameters
    Type Name Description
    SharpDX.Vector3 vector3

    Extended SharpDX Vector2

    Returns
    Type Description
    System.Single

    Polar for Vector Angle (Degrees)

    Pow(Double)

    Declaration
    public static double Pow(this double number)
    Parameters
    Type Name Description
    System.Double number
    Returns
    Type Description
    System.Double

    Pow(Int32)

    Declaration
    public static int Pow(this int number)
    Parameters
    Type Name Description
    System.Int32 number
    Returns
    Type Description
    System.Int32

    Pow(Single)

    Declaration
    public static float Pow(this float number)
    Parameters
    Type Name Description
    System.Single number
    Returns
    Type Description
    System.Single

    Pow(UInt32)

    Declaration
    public static uint Pow(this uint number)
    Parameters
    Type Name Description
    System.UInt32 number
    Returns
    Type Description
    System.UInt32

    ProjectOn(Vector2, Vector2, Vector2)

    Returns the projection of the Vector2 on the segment.

    Declaration
    public static ProjectionInfo ProjectOn(this Vector2 point, Vector2 segmentStart, Vector2 segmentEnd)
    Parameters
    Type Name Description
    SharpDX.Vector2 point

    The Point

    SharpDX.Vector2 segmentStart

    Start of Segment

    SharpDX.Vector2 segmentEnd

    End of Segment

    Returns
    Type Description
    ProjectionInfo

    ProjectionInfo containing the projection.

    ProjectOn(Vector3, Vector3, Vector3)

    Converts the points to 2D, then returns the projection of the Vector2 on the segment.

    Declaration
    public static ProjectionInfo ProjectOn(this Vector3 point, Vector3 segmentStart, Vector3 segmentEnd)
    Parameters
    Type Name Description
    SharpDX.Vector3 point

    The point

    SharpDX.Vector3 segmentStart

    Start of Segment

    SharpDX.Vector3 segmentEnd

    End of Segment

    Returns
    Type Description
    ProjectionInfo

    ProjectionInfo containing the projection.

    Rotated(Vector2, Single)

    Rotates the Vector2 to a set angle.

    Declaration
    public static Vector2 Rotated(this Vector2 vector2, float angle)
    Parameters
    Type Name Description
    SharpDX.Vector2 vector2

    Extended SharpDX Vector2

    System.Single angle

    Angle (in radians)

    Returns
    Type Description
    SharpDX.Vector2

    Rotated Vector2

    Rotated(Vector3, Single)

    Rotates the Vector3 to a set angle.

    Declaration
    public static Vector3 Rotated(this Vector3 vector3, float angle)
    Parameters
    Type Name Description
    SharpDX.Vector3 vector3

    Extended SharpDX Vector2

    System.Single angle

    Angle (in radians)

    Returns
    Type Description
    SharpDX.Vector3

    Rotated Vector3

    SetFlags<T>(T, T, Boolean)

    Sets the given flags to the struct source, given struct must be an enumeration with flag attributes.

    Declaration
    public static T SetFlags<T>(this T value, T flags, bool status = true)
        where T : struct
    Parameters
    Type Name Description
    T value

    The enumeration

    T flags

    The flags to be set

    System.Boolean status

    Turn flags on or off

    Returns
    Type Description
    T

    Enumeration with Flag Attributes (struct)

    Type Parameters
    Name Description
    T

    Flag with Attributes type.

    Shorten(Vector2, Vector2, Single)

    Shortens the specified vector.

    Declaration
    public static Vector2 Shorten(this Vector2 v, Vector2 to, float distance)
    Parameters
    Type Name Description
    SharpDX.Vector2 v

    The vector.

    SharpDX.Vector2 to

    The vector to shorten from.

    System.Single distance

    The distance.

    Returns
    Type Description
    SharpDX.Vector2

    Shorten(Vector3, Vector3, Single)

    Shortens the specified vector.

    Declaration
    public static Vector3 Shorten(this Vector3 v, Vector3 to, float distance)
    Parameters
    Type Name Description
    SharpDX.Vector3 v

    The vector.

    SharpDX.Vector3 to

    The vector to shorten from.

    System.Single distance

    The distance.

    Returns
    Type Description
    SharpDX.Vector3

    Sqrt(Double)

    Declaration
    public static double Sqrt(this double number)
    Parameters
    Type Name Description
    System.Double number
    Returns
    Type Description
    System.Double

    Sqrt(Int32)

    Declaration
    public static double Sqrt(this int number)
    Parameters
    Type Name Description
    System.Int32 number
    Returns
    Type Description
    System.Double

    Sqrt(Single)

    Declaration
    public static double Sqrt(this float number)
    Parameters
    Type Name Description
    System.Single number
    Returns
    Type Description
    System.Double

    Sqrt(UInt32)

    Declaration
    public static double Sqrt(this uint number)
    Parameters
    Type Name Description
    System.UInt32 number
    Returns
    Type Description
    System.Double

    StandardDeviation(IEnumerable<Int32>)

    Standard Deviation of the values list.

    Declaration
    public static double StandardDeviation(this IEnumerable<int> values)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<System.Int32> values

    Values list

    Returns
    Type Description
    System.Double

    Standard Deviation

    To<T>(IConvertible)

    Converts an item to another Type

    Declaration
    public static T To<T>(this IConvertible object)
    Parameters
    Type Name Description
    System.IConvertible object

    The object to convert to

    Returns
    Type Description
    T

    The converted object

    Type Parameters
    Name Description
    T

    Type to convert to

    To2D(List<Vector3>)

    Declaration
    public static List<Vector2> To2D(this List<Vector3> points)
    Parameters
    Type Name Description
    System.Collections.Generic.List<SharpDX.Vector3> points
    Returns
    Type Description
    System.Collections.Generic.List<SharpDX.Vector2>

    To3D(List<Vector2>)

    Declaration
    public static List<Vector3> To3D(this List<Vector2> points)
    Parameters
    Type Name Description
    System.Collections.Generic.List<SharpDX.Vector2> points
    Returns
    Type Description
    System.Collections.Generic.List<SharpDX.Vector3>

    ToVector2(Vector3)

    Transforms an extended Vector3 into a Vector2.

    Declaration
    public static Vector2 ToVector2(this Vector3 vector3)
    Parameters
    Type Name Description
    SharpDX.Vector3 vector3

    SharpDX Vector3

    Returns
    Type Description
    SharpDX.Vector2

    The SharpDX.Vector2

    ToVector2(List<Vector3>)

    Transforms an extended Vector3 List into a Vector2 List.

    Declaration
    public static List<Vector2> ToVector2(this List<Vector3> path)
    Parameters
    Type Name Description
    System.Collections.Generic.List<SharpDX.Vector3> path

    The path.

    Returns
    Type Description
    System.Collections.Generic.List<SharpDX.Vector2>

    Vector2 List

    ToVector3(Vector2, Single)

    Transforms an extended Vector2 into a Vector3.

    Declaration
    public static Vector3 ToVector3(this Vector2 vector2, float z = 0F)
    Parameters
    Type Name Description
    SharpDX.Vector2 vector2

    SharpDX Vector2

    System.Single z

    Float Z-axis (default = 0f)

    Returns
    Type Description
    SharpDX.Vector3

    The SharpDX.Vector3

    ToVector4(Vector2, Single, Single)

    Transforms an extended Vector2 into a Vector4.

    Declaration
    public static Vector4 ToVector4(this Vector2 vector2, float z = 0F, float w = 1F)
    Parameters
    Type Name Description
    SharpDX.Vector2 vector2

    SharpDX Vector2

    System.Single z

    Float Z-axis (default = 0f)

    System.Single w

    Float W-axis (default = 0f)

    Returns
    Type Description
    SharpDX.Vector4

    The SharpDX.Vector4

    ToVector4(Vector3, Single)

    Transforms an extended Vector3 into a Vector4.

    Declaration
    public static Vector4 ToVector4(this Vector3 vector3, float w = 1F)
    Parameters
    Type Name Description
    SharpDX.Vector3 vector3

    SharpDX Vector3

    System.Single w

    Float W-axis (default = 0f)

    Returns
    Type Description
    SharpDX.Vector4

    The SharpDX.Vector4

    ToVector4(List<Vector2>)

    Transforms an extended Vector2 List into a Vector4 List.

    Declaration
    public static List<Vector4> ToVector4(this List<Vector2> path)
    Parameters
    Type Name Description
    System.Collections.Generic.List<SharpDX.Vector2> path

    The path.

    Returns
    Type Description
    System.Collections.Generic.List<SharpDX.Vector4>

    Vector4 List

    ToVector4(List<Vector3>)

    Transforms an extended Vector3 List into a Vector4 List.

    Declaration
    public static List<Vector4> ToVector4(this List<Vector3> path)
    Parameters
    Type Name Description
    System.Collections.Generic.List<SharpDX.Vector3> path

    The path.

    Returns
    Type Description
    System.Collections.Generic.List<SharpDX.Vector4>

    Vector4 List

    ToW2S(Vector3)

    Convert vector3 position to world to screen position as vector2.

    Declaration
    public static Vector2 ToW2S(this Vector3 sourceVector3)
    Parameters
    Type Name Description
    SharpDX.Vector3 sourceVector3

    Vector3 position

    Returns
    Type Description
    SharpDX.Vector2

    World to screen position as vector2

    ToWorldToMap(Vector3)

    Get minimap position on screen.

    Declaration
    public static Vector2 ToWorldToMap(this Vector3 vector3)
    Parameters
    Type Name Description
    SharpDX.Vector3 vector3

    The world position to calculate.

    Returns
    Type Description
    SharpDX.Vector2

    The map position.

    VectorMovementCollision(Vector2, Vector2, Single, Vector2, Single, Single)

    Calculates movement collision between two vectors points.

    Declaration
    public static MovementCollisionInfo VectorMovementCollision(this Vector2 pointStartA, Vector2 pointEndA, float pointVelocityA, Vector2 pointB, float pointVelocityB, float delay = 0F)
    Parameters
    Type Name Description
    SharpDX.Vector2 pointStartA

    Point A Start.

    SharpDX.Vector2 pointEndA

    Point A End.

    System.Single pointVelocityA

    Point A Velocity.

    SharpDX.Vector2 pointB

    Point B.

    System.Single pointVelocityB

    Point B Velocity.

    System.Single delay

    Additional Delay.

    Returns
    Type Description
    MovementCollisionInfo

    The MovementCollisionInfo.

    VectorMovementCollision(Vector2[], Single, Vector2, Single, Single)

    Calculates movement collision between two vectors points.

    Declaration
    public static MovementCollisionInfo VectorMovementCollision(this Vector2[] pointA, float pointVelocityA, Vector2 pointB, float pointVelocityB, float delay = 0F)
    Parameters
    Type Name Description
    SharpDX.Vector2[] pointA

    Point A.

    System.Single pointVelocityA

    Point A Velocity.

    SharpDX.Vector2 pointB

    Point B.

    System.Single pointVelocityB

    Point B Velocity.

    System.Single delay

    Additional Delay.

    Returns
    Type Description
    MovementCollisionInfo

    The MovementCollisionInfo.

    ☀
    ☾
    In This Article
    Back to top
    Generated by DocFX
    ☀
    ☾