C++ Project 2016-2017: Arkanoid
|
Representation of a vector. More...
#include <vector2D.h>
Public Member Functions | |
Vector2D () | |
Vector2D (double newX, double newY) | |
Vector2D | operator+ (const Vector2D &other) const |
void | operator= (const Vector2D &other) |
void | operator+= (const Vector2D &other) |
Vector2D | operator* (double factor) const |
void | operator*= (double factor) |
Public Attributes | |
double | x |
The 'x' component of the Vector2D. | |
double | y |
The 'y' component of the Vector2D. | |
Friends | |
ostream & | operator<< (ostream &stream, Vector2D &vector) |
Representation of a vector.
Definition at line 14 of file vector2D.h.
arkanoid::Vector2D::Vector2D | ( | ) |
Default Constructor.
Definition at line 11 of file vector2D.cpp.
arkanoid::Vector2D::Vector2D | ( | double | newX, |
double | newY | ||
) |
Constructor.
newX | The 'x' component of the new constructed Vector2D. |
newY | The 'y' component of the new constructed Vector2D. |
Definition at line 13 of file vector2D.cpp.
Vector2D arkanoid::Vector2D::operator* | ( | double | factor | ) | const |
'*' Overloader.
Multiply the Vector2D by a factor.
factor | The factor. |
Definition at line 29 of file vector2D.cpp.
void arkanoid::Vector2D::operator*= | ( | double | factor | ) |
'*=' Overloader.
Multiply the Vector2D by a factor and asign it to this Vector2D.
factor | The factor. |
Definition at line 33 of file vector2D.cpp.
void arkanoid::Vector2D::operator+= | ( | const Vector2D & | other | ) |
void arkanoid::Vector2D::operator= | ( | const Vector2D & | other | ) |
'=' Overloader.
Asign new values to this Vector2D.
other | The Vector2D that contains the new values 'x' and 'y'. |
Definition at line 19 of file vector2D.cpp.
|
friend |
'<<' Overloader.
Prints the values of this Vector2D (debugging reasons).
stream | The stream where the outputs is in. |
vector | The vector of which the output is printed. |
Definition at line 38 of file vector2D.cpp.