The Battle for Wesnoth  1.19.0-dev
Public Member Functions | List of all members
point Struct Reference

Holds a 2D point. More...

#include <point.hpp>

Inheritance diagram for point:

Public Member Functions

constexpr point ()
 Initialize to 0 by default. More...
 
constexpr point (int x, int y)
 
constexpr point (const SDL_Point &p)
 
constexpr bool operator== (const point &point) const
 
constexpr bool operator!= (const point &point) const
 
constexpr bool operator< (const point &point) const
 
constexpr bool operator<= (const point &point) const
 
constexpr point operator+ (const point &point) const
 
constexpr pointoperator+= (const point &point)
 
constexpr point operator- () const
 
constexpr point operator- (const point &point) const
 
constexpr pointoperator-= (const point &point)
 
constexpr point operator* (int s) const
 
constexpr pointoperator*= (int s)
 
constexpr point operator/ (int s) const
 
constexpr pointoperator/= (int s)
 
constexpr point operator* (const point &p) const
 
constexpr pointoperator*= (const point &p)
 
constexpr point operator/ (const point &p) const
 
constexpr pointoperator/= (const point &p)
 

Detailed Description

Holds a 2D point.

This is a thin wrapper over SDL_Point.

Definition at line 24 of file point.hpp.

Constructor & Destructor Documentation

◆ point() [1/3]

constexpr point::point ( )
inlineconstexpr

Initialize to 0 by default.

Definition at line 27 of file point.hpp.

◆ point() [2/3]

constexpr point::point ( int  x,
int  y 
)
inlineconstexpr

Definition at line 29 of file point.hpp.

◆ point() [3/3]

constexpr point::point ( const SDL_Point &  p)
inlineconstexpr

Definition at line 31 of file point.hpp.

Member Function Documentation

◆ operator!=()

constexpr bool point::operator!= ( const point point) const
inlineconstexpr

Definition at line 38 of file point.hpp.

References operator==().

◆ operator*() [1/2]

constexpr point point::operator* ( const point p) const
inlineconstexpr

Definition at line 108 of file point.hpp.

References p.

◆ operator*() [2/2]

constexpr point point::operator* ( int  s) const
inlineconstexpr

Definition at line 82 of file point.hpp.

References s.

◆ operator*=() [1/2]

constexpr point& point::operator*= ( const point p)
inlineconstexpr

Definition at line 113 of file point.hpp.

References p.

◆ operator*=() [2/2]

constexpr point& point::operator*= ( int  s)
inlineconstexpr

Definition at line 87 of file point.hpp.

References s.

◆ operator+()

constexpr point point::operator+ ( const point point) const
inlineconstexpr

Definition at line 53 of file point.hpp.

◆ operator+=()

constexpr point& point::operator+= ( const point point)
inlineconstexpr

Definition at line 58 of file point.hpp.

◆ operator-() [1/2]

constexpr point point::operator- ( ) const
inlineconstexpr

Definition at line 65 of file point.hpp.

◆ operator-() [2/2]

constexpr point point::operator- ( const point point) const
inlineconstexpr

Definition at line 70 of file point.hpp.

◆ operator-=()

constexpr point& point::operator-= ( const point point)
inlineconstexpr

Definition at line 75 of file point.hpp.

◆ operator/() [1/2]

constexpr point point::operator/ ( const point p) const
inlineconstexpr

Definition at line 120 of file point.hpp.

References p.

◆ operator/() [2/2]

constexpr point point::operator/ ( int  s) const
inlineconstexpr

Definition at line 94 of file point.hpp.

References s.

◆ operator/=() [1/2]

constexpr point& point::operator/= ( const point p)
inlineconstexpr

Definition at line 125 of file point.hpp.

References p.

◆ operator/=() [2/2]

constexpr point& point::operator/= ( int  s)
inlineconstexpr

Definition at line 99 of file point.hpp.

References s.

◆ operator<()

constexpr bool point::operator< ( const point point) const
inlineconstexpr

Definition at line 43 of file point.hpp.

◆ operator<=()

constexpr bool point::operator<= ( const point point) const
inlineconstexpr

Definition at line 48 of file point.hpp.

◆ operator==()

constexpr bool point::operator== ( const point point) const
inlineconstexpr

Definition at line 33 of file point.hpp.

Referenced by operator!=().


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