cmdfx 0.2.1
Lightweight game engine for your terminal
Loading...
Searching...
No Matches
CmdFX::Vector Class Referencefinal

A C++ wrapper around a CmdFX_Vector struct. More...

#include <util.hpp>

Public Member Functions

 Vector (CmdFX_Vector *vector)
 
 Vector (double x, double y)
 
CmdFX_VectorgetVector ()
 
double getX () const
 
double getY () const
 
double getMagnitude () const
 
void setX (double x)
 
void setY (double y)
 
Vector operator+ (const Vector &other) const
 
Vector operator+ (const std::vector< Vector > &vectors) const
 
Vectoroperator+= (const Vector &other)
 
Vector operator- (const Vector &other) const
 
Vectoroperator-= (const Vector &other)
 
Vector operator* (double scalar) const
 
Vectoroperator*= (double scalar)
 
Vector operator/ (double scalar) const
 
Vectoroperator/= (double scalar)
 
int rotate (double radians)
 
double getAngle ()
 
int flipX ()
 
int flipY ()
 
int flip ()
 
int dot (const Vector &other) const
 

Detailed Description

A C++ wrapper around a CmdFX_Vector struct.

This class is a wrapper around the CmdFX_Vector struct. It provides a constructor and destructor for the vector, as well as methods to get and set the vector's coordinates. The destructor will free the vector's memory when the object is destroyed.


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