Easy_rider
 
Loading...
Searching...
No Matches
Intersection Class Reference

Represents a point (intersection) in a 2D coordinate system. More...

#include <Intersection.h>

Public Member Functions

 Intersection ()
 Default constructor.
 
 Intersection (int x, int y)
 Parameterized constructor.
 
void setPosition (int x, int y)
 Sets a new position for the intersection.
 
std::pair< int, int > getPosition () const
 Retrieves the current position of the intersection.
 
int getX () const
 Retrieves the x-coordinate.
 
int getY () const
 Retrieves the y-coordinate.
 

Detailed Description

Represents a point (intersection) in a 2D coordinate system.

Constructor & Destructor Documentation

◆ Intersection()

Intersection::Intersection ( int  x,
int  y 
)

Parameterized constructor.

Parameters
xThe x-coordinate.
yThe y-coordinate.

Member Function Documentation

◆ getPosition()

std::pair< int, int > Intersection::getPosition ( ) const

Retrieves the current position of the intersection.

Returns
A std::pair where first is x-coordinate and second is y-coordinate.

◆ getX()

int Intersection::getX ( ) const

Retrieves the x-coordinate.

Returns
The current x-coordinate.

◆ getY()

int Intersection::getY ( ) const

Retrieves the y-coordinate.

Returns
The current y-coordinate.

◆ setPosition()

void Intersection::setPosition ( int  x,
int  y 
)

Sets a new position for the intersection.

Parameters
xThe new x-coordinate.
yThe new y-coordinate.

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