Conquer Chess
Chess and Starcraft combined
Loading...
Searching...
No Matches
Classes | Functions
screen_coordinate.h File Reference
#include <iosfwd>
Include dependency graph for screen_coordinate.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  screen_coordinate
 The coordinate on a screen. More...
 

Functions

double calc_angle_degrees (const screen_coordinate &from, const screen_coordinate &to)
 Calculate the angle in degrees.
 
double calc_angle_degrees (const screen_coordinate &delta)
 Calculate the angle in degrees.
 
double calc_distance (const screen_coordinate &a, const screen_coordinate &b) noexcept
 Calculate the Euclidean distance.
 
std::string to_str (const screen_coordinate &c) noexcept
 
std::ostream & operator<< (std::ostream &os, const screen_coordinate &coordinat)
 
bool operator== (const screen_coordinate &lhs, const screen_coordinate &rhs) noexcept
 
bool operator!= (const screen_coordinate &lhs, const screen_coordinate &rhs) noexcept
 
screen_coordinate operator+ (const screen_coordinate &lhs, const screen_coordinate &rhs) noexcept
 
screen_coordinate operator- (const screen_coordinate &lhs, const screen_coordinate &rhs) noexcept
 
screen_coordinate operator* (const screen_coordinate &lhs, const double &factor) noexcept
 
screen_coordinate operator/ (const screen_coordinate &lhs, const double &factor)
 
screen_coordinateoperator+= (screen_coordinate &lhs, const screen_coordinate &rhs) noexcept
 
void test_screen_coordinate ()
 Run the tests for the screen coordinat.
 

Function Documentation

◆ calc_angle_degrees() [1/2]

double calc_angle_degrees ( const screen_coordinate delta)

Calculate the angle in degrees.

dx dy o'clock degrees
1 0 3 0
0 1 6 270
-1 0 9 180
0 -1 12 90

◆ calc_angle_degrees() [2/2]

double calc_angle_degrees ( const screen_coordinate from,
const screen_coordinate to 
)

Calculate the angle in degrees.

dx dy o'clock degrees
1 0 3 0
0 1 6 270
-1 0 9 180
0 -1 12 90

◆ calc_distance()

double calc_distance ( const screen_coordinate a,
const screen_coordinate b 
)
noexcept

Calculate the Euclidean distance.

◆ operator!=()

bool operator!= ( const screen_coordinate lhs,
const screen_coordinate rhs 
)
noexcept

◆ operator*()

screen_coordinate operator* ( const screen_coordinate lhs,
const double &  factor 
)
noexcept

◆ operator+()

screen_coordinate operator+ ( const screen_coordinate lhs,
const screen_coordinate rhs 
)
noexcept

◆ operator+=()

screen_coordinate & operator+= ( screen_coordinate lhs,
const screen_coordinate rhs 
)
noexcept

◆ operator-()

screen_coordinate operator- ( const screen_coordinate lhs,
const screen_coordinate rhs 
)
noexcept

◆ operator/()

screen_coordinate operator/ ( const screen_coordinate lhs,
const double &  factor 
)

◆ operator<<()

std::ostream & operator<< ( std::ostream &  os,
const screen_coordinate coordinat 
)

◆ operator==()

bool operator== ( const screen_coordinate lhs,
const screen_coordinate rhs 
)
noexcept

◆ test_screen_coordinate()

void test_screen_coordinate ( )

Run the tests for the screen coordinat.

◆ to_str()

std::string to_str ( const screen_coordinate c)
noexcept