C++ Project 2016-2017: Arkanoid
vector2D.h
Go to the documentation of this file.
1 
3 #ifndef VECTOR2D_H
4 #define VECTOR2D_H
5 
6 #include <iostream>
7 
8 using namespace std;
9 
10 
11 namespace arkanoid {
12 
14  class Vector2D {
15  public:
16 
17  double x;
18  double y;
19 
23  Vector2D();
24 
31  Vector2D(double newX, double newY);
32 
42  Vector2D operator+(const Vector2D &other) const;
43 
51  void operator=(const Vector2D &other);
52 
60  void operator+=(const Vector2D &other);
61 
71  Vector2D operator*(double factor) const;
72 
80  void operator*=(double factor);
81 
90  friend ostream& operator<<(ostream& stream, Vector2D& vector);
91 
92  };
93 
94 }
95 
96 #endif /* VECTOR2D_H */
Representation of a vector.
Definition: vector2D.h:14
ostream & operator<<(ostream &stream, Vector2D &vector)
Definition: vector2D.cpp:38
double y
The &#39;y&#39; component of the Vector2D.
Definition: vector2D.h:18
double x
The &#39;x&#39; component of the Vector2D.
Definition: vector2D.h:17
All the game logic of the Arkanoid game.
Definition: ball.cpp:15