C# Class WebGame.Utility

Datei anzeigen Open project: AdmiralPotato/ggj2013

Public Properties

Property Type Description
Random System.Random

Public Methods

Method Description
ApproximatelyEqual ( double left, double right, double epsilon = 0.001 ) : bool
FromUnixTimestamp ( int unixTimestamp ) : System.DateTime

Creates a new System.DateTime from the specified timestamp (time measured in the number of seconds).

Magnitude ( this vector ) : double
Multiply ( this vector, double coefficient ) : Vector3
NormalizeOrientation ( this angle ) : double
NormalizeTurn ( this angle ) : double
PointToSegmentDistance ( Vector3 segmentBegin, Vector3 segmentEnd, Vector3 point ) : double
PrintTimeSpan ( this time, bool isInPast = true ) : string
Quadrance ( this vector ) : double
SphereIntersectsLineSegment ( Vector3 segmentBegin, Vector3 segmentEnd, Vector3 sphereCenter, double radius ) : bool
UnixTimestamp ( System.DateTime dateTime ) : int

Returns the specified time measured in the number of seconds.

randomBool ( ) : bool

Private Methods

Method Description
_NormalizeAngle ( this angle, double lowerBound, double upperBound, double range = 2*Math.PI ) : double

Method Details

ApproximatelyEqual() public static method

public static ApproximatelyEqual ( double left, double right, double epsilon = 0.001 ) : bool
left double
right double
epsilon double
return bool

FromUnixTimestamp() public static method

Creates a new System.DateTime from the specified timestamp (time measured in the number of seconds).
public static FromUnixTimestamp ( int unixTimestamp ) : System.DateTime
unixTimestamp int The timestamp that represents the date to be created.
return System.DateTime

Magnitude() public static method

public static Magnitude ( this vector ) : double
vector this
return double

Multiply() public static method

public static Multiply ( this vector, double coefficient ) : Vector3
vector this
coefficient double
return Vector3

NormalizeOrientation() public static method

public static NormalizeOrientation ( this angle ) : double
angle this
return double

NormalizeTurn() public static method

public static NormalizeTurn ( this angle ) : double
angle this
return double

PointToSegmentDistance() public static method

public static PointToSegmentDistance ( Vector3 segmentBegin, Vector3 segmentEnd, Vector3 point ) : double
segmentBegin Vector3
segmentEnd Vector3
point Vector3
return double

PrintTimeSpan() public static method

public static PrintTimeSpan ( this time, bool isInPast = true ) : string
time this
isInPast bool
return string

Quadrance() public static method

public static Quadrance ( this vector ) : double
vector this
return double

SphereIntersectsLineSegment() public static method

public static SphereIntersectsLineSegment ( Vector3 segmentBegin, Vector3 segmentEnd, Vector3 sphereCenter, double radius ) : bool
segmentBegin Vector3
segmentEnd Vector3
sphereCenter Vector3
radius double
return bool

UnixTimestamp() public static method

Returns the specified time measured in the number of seconds.
public static UnixTimestamp ( System.DateTime dateTime ) : int
dateTime System.DateTime The System.DateTime to obtain the number of seconds from.
return int

randomBool() public static method

public static randomBool ( ) : bool
return bool

Property Details

Random public_oe static_oe property

public static Random,System Random
return System.Random