CellModules
Grid2D::Vec2D Struct Reference

Structure representing a 2D vector. More...

#include <CellGrid.hpp>

Public Member Functions

 Vec2D (int x_, int y_)
 Constructor to initialize the vector with given coordinates. More...
 
int x () const
 Get the X-coordinate. More...
 
int y () const
 Get the Y-coordinate. More...
 
bool operator== (Vec2D v)
 Equality operator to compare two Vec2D objects. More...
 

Public Attributes

int xc = 0
 
int yc = 0
 

Detailed Description

Structure representing a 2D vector.

Definition at line 14 of file CellGrid.hpp.

Constructor & Destructor Documentation

◆ Vec2D()

Grid2D::Vec2D::Vec2D ( int  x_,
int  y_ 
)
inline

Constructor to initialize the vector with given coordinates.

Parameters
x_X-coordinate
y_Y-coordinate

Definition at line 23 of file CellGrid.hpp.

Member Function Documentation

◆ operator==()

bool Grid2D::Vec2D::operator== ( Vec2D  v)
inline

Equality operator to compare two Vec2D objects.

Parameters
vAnother Vec2D object
Returns
True if both vectors have the same coordinates, false otherwise.

Definition at line 42 of file CellGrid.hpp.

◆ x()

int Grid2D::Vec2D::x ( ) const
inline

Get the X-coordinate.

Returns
X-coordinate

Definition at line 29 of file CellGrid.hpp.

◆ y()

int Grid2D::Vec2D::y ( ) const
inline

Get the Y-coordinate.

Returns
Y-coordinate

Definition at line 35 of file CellGrid.hpp.

Member Data Documentation

◆ xc

int Grid2D::Vec2D::xc = 0

X-coordinate

Definition at line 15 of file CellGrid.hpp.

◆ yc

int Grid2D::Vec2D::yc = 0

Y-coordinate

Definition at line 16 of file CellGrid.hpp.


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