|
Britbot
|
This class accumulates direction over large number of turns we assume (0,0) is the left top corner of the screen and that. More...
Public Member Functions | |
| HeadingVector (Direction d=Direction.NOTHING) | |
| Conversion constructor: takes a direction of the game and turns it into a vector. | |
| HeadingVector (HeadingVector toCopy) | |
| Copy constructor. | |
| HeadingVector (double x, double y) | |
| Simple assignment constructor. | |
| override int | GetHashCode () |
| Gets a unique-ish hascide for the instance. | |
| void | SetCoordinates (double x=0, double y=0) |
| regular set function for convenience sets both X and Y simultaneously | |
| void | SetCoordinates (HeadingVector hv) |
| Copies the parameters of a given heading vector. | |
| HeadingVector | adjustHeading (HeadingVector Dir) |
| same as the previous function just used as a method | |
| HeadingVector | adjustHeading (Direction Dir) |
| same as the previous function just gets a direction | |
| HeadingVector | Orthogonal () |
| Calculates a new vector perpendicular to the given one it simply rotates 90 degrees anti clockwise. | |
| double | NormSquared () |
| Returns the square of the vector's length might be used to normalize vectors for some computation. | |
| double | Norm () |
| returns the length of the vector (as a double) might be used to normalize vectors for some computation | |
| HeadingVector | Normalize () |
| returns a new normalized vector | |
| double | Norm1 () |
| returns the sum of X and Y meaning the duration of time of the calculation. this can be used as a creditability measure | |
| override string | ToString () |
| To string function... | |
| override bool | Equals (object obj) |
| Check if the two objects are the same. | |
Static Public Member Functions | |
| static double | operator* (HeadingVector hv1, HeadingVector hv2) |
| calculates the dot product for two vectors used to check if angles are sharp or doll (if they are the correct terms) | |
| static HeadingVector | adjustHeading (HeadingVector hv1, HeadingVector hv2) |
| this static method updates the direction based on the new one if the new direction is not to far from the one given (up to 90 degrees) it simply adds to the previous count vector otherwise, we assume there was a change in course and so we start again | |
| static HeadingVector | adjustHeading (HeadingVector hv1, Direction dir) |
| same as the previous one just gets a direction insted of a heading vector | |
| static HeadingVector | CalcDifference (Location source, Location target) |
| Calculates the direction vector between two points. | |
| static Location | AddvanceByVector (Location loc, HeadingVector hv) |
| given your location and your heading this function calculates your new position after going with the vector. consider the bounderies of the game | |
| static bool | operator== (HeadingVector hv1, HeadingVector hv2) |
| Get a hash code for this instance. Should be use by system sorting and what not. ReSharper generated code. | |
| static bool | operator!= (HeadingVector hv1, HeadingVector hv2) |
| checks if two vectors are not the same: compares both entries | |
| static HeadingVector | operator+ (HeadingVector hv1, HeadingVector hv2) |
| regular "algebraic" sum of two vectors | |
| static HeadingVector | operator- (HeadingVector hv1, HeadingVector hv2) |
| regular "algebraic" difference between two vectors | |
| static HeadingVector | operator* (double scalar, HeadingVector hv) |
| just scalar multipication | |
Protected Member Functions | |
| bool | Equals (HeadingVector other) |
| Enumerates the location determined by the direction if this heading vector and the pivot supplied. | |
Properties | |
| double | X [get, set] |
| Positive X value means left and vice-versa. | |
| double | Y [get, set] |
| Positive Y value means down and vice-versa. | |
This class accumulates direction over large number of turns we assume (0,0) is the left top corner of the screen and that.
Definition at line 14 of file HeadingVector.cs.
1.7.6.1