C# Class SafeAndFree.Helpers.Calculator

Generic match helper methods.
Show file Open project: mokasocial/PrivacyDefense

Public Methods

Method Description
BestShootableCreep ( List targets, Vector2 towerPosition, int range, Creep &creep ) : bool

Not yet the best shootable creep, right now just any creep returns true if there's a valid creep, creep is the target

GetDistance ( Vector2 pos1, Vector2 pos2 ) : double

Get the distance between two points.

MovementTowardsPoint ( Vector2 start, Vector2 end, int speed, bool &Connected ) : Vector2

Gives the movement vector for an object to move towards the given point.

ToDegrees ( float radians ) : float
ToRadians ( float degrees ) : float

Method Details

BestShootableCreep() public static method

Not yet the best shootable creep, right now just any creep returns true if there's a valid creep, creep is the target
public static BestShootableCreep ( List targets, Vector2 towerPosition, int range, Creep &creep ) : bool
targets List
towerPosition Vector2
range int
creep Creep
return bool

GetDistance() public static method

Get the distance between two points.
public static GetDistance ( Vector2 pos1, Vector2 pos2 ) : double
pos1 Vector2 The first point.
pos2 Vector2 The second point.
return double

MovementTowardsPoint() public static method

Gives the movement vector for an object to move towards the given point.
public static MovementTowardsPoint ( Vector2 start, Vector2 end, int speed, bool &Connected ) : Vector2
start Vector2 The position to move from.
end Vector2 The position to move to.
speed int The vector's magnitude.
Connected bool True if the vector
return Vector2

ToDegrees() public static method

public static ToDegrees ( float radians ) : float
radians float
return float

ToRadians() public static method

public static ToRadians ( float degrees ) : float
degrees float
return float