Platformer
Platformer
Public Member Functions | Public Attributes | List of all members
Vector2 Class Reference

Basic class representation of a vector 2 with an x and y coordinate. More...

#include <Vector2.hpp>

Collaboration diagram for Vector2:
Collaboration graph

Public Member Functions

 Vector2 ()
 Constructs a default Vector2.
 
 Vector2 (int x, int y)
 Constructs a Vector2 with the given coordinates. More...
 
void operator+= (const Vector2 &other)
 Adds two vectors together.
 
Vector2 operator* (const int other)
 Multiplies two vectors together. More...
 

Public Attributes

int x
 The x coordinate of the vector.
 
int y
 The y coordinate of the vector.
 

Detailed Description

Basic class representation of a vector 2 with an x and y coordinate.

Constructor & Destructor Documentation

◆ Vector2()

Vector2::Vector2 ( int  x,
int  y 
)

Constructs a Vector2 with the given coordinates.

Parameters
xThe x coordinate of the vector
yThe y coordinate of the vector

Member Function Documentation

◆ operator*()

Vector2 Vector2::operator* ( const int  other)

Multiplies two vectors together.

Returns
The multiplied vector
Here is the call graph for this function:

The documentation for this class was generated from the following files: