StarEngine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
pos.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "../../defines.h"
4 
5 namespace star
6 {
7  struct pos
8  {
9  float x, y;
10  lay l;
11 
12  pos();
13  pos(const vec2 & vec, lay layer = LAYER_DEF);
14  pos(double X, double Y, lay layer = LAYER_DEF);
15  pos(float X, float Y, lay layer = LAYER_DEF);
16  pos(int X, int Y, lay layer = LAYER_DEF);
17  pos(long X, long Y, lay layer = LAYER_DEF);
18  pos(const pos & yRef);
19  pos(pos && yRef);
20 
21  bool operator==(const pos & yRef) const;
22  bool operator==(const vec2 & yRef) const;
23  bool operator!=(const pos & yRef) const;
24  bool operator!=(const vec2 & yRef) const;
25 
26  pos & operator=(const pos & yRef);
27  pos & operator=(const vec2 & yRef);
28  pos & operator+=(const pos & yRef);
29  pos & operator+=(const vec2 & yRef);
30  pos & operator-=(const pos & yRef);
31  pos & operator-=(const vec2 & yRef);
32  pos operator+(const pos & yRef) const;
33  pos operator+(const vec2 & yRef) const;
34  pos operator-(const pos & yRef) const;
35  pos operator-(const vec2 & yRef) const;
36 
37  pos & operator*=(unsigned int n);
38  pos & operator*=(unsigned long n);
39  pos & operator*=(int n);
40  pos & operator*=(long n);
41  pos & operator*=(float n);
42  pos & operator*=(double n);
43 
44  pos & operator/=(unsigned int n);
45  pos & operator/=(unsigned long n);
46  pos & operator/=(int n);
47  pos & operator/=(long n);
48  pos & operator/=(float n);
49  pos & operator/=(double n);
50 
51  pos operator*(unsigned int n);
52  pos operator*(unsigned long n);
53  pos operator*(int n);
54  pos operator*(long n);
55  pos operator*(float n);
56  pos operator*(double n);
57 
58  pos operator/(unsigned int n);
59  pos operator/(unsigned long n);
60  pos operator/(int n);
61  pos operator/(long n);
62  pos operator/(float n);
63  pos operator/(double n);
64 
65  vec2 pos2D() const;
66  vec3 pos3D() const;
67 
68  float length() const;
69 
70  friend pos operator*(unsigned int n, const pos & yRef);
71  friend pos operator*(unsigned long n, const pos & yRef);
72  friend pos operator*(int n, const pos & yRef);
73  friend pos operator*(long n, const pos & yRef);
74  friend pos operator*(float n, const pos & yRef);
75  friend pos operator*(double n, const pos & yRef);
76  friend pos operator*(const vec2 & v, const pos & yRef);
77 
78  friend pos operator/(unsigned int n, const pos & yRef);
79  friend pos operator/(unsigned long n, const pos & yRef);
80  friend pos operator/(int n, const pos & yRef);
81  friend pos operator/(long n, const pos & yRef);
82  friend pos operator/(float n, const pos & yRef);
83  friend pos operator/(double n, const pos & yRef);
84  friend pos operator/(const vec2 & v, const pos & yRef);
85 
86  friend bool operator==(const vec2 & lRef, const pos & rRef);
87  friend bool operator!=(const vec2 & lRef, const pos & rRef);
88  };
89 }
pos & operator=(const pos &yRef)
Definition: pos.cpp:94
lay l
Definition: pos.h:10
pos & operator-=(const pos &yRef)
Definition: pos.cpp:127
float length() const
Definition: pos.cpp:534
pos & operator/=(unsigned int n)
Definition: pos.cpp:323
pos & operator+=(const pos &yRef)
Definition: pos.cpp:111
pos operator+(const pos &yRef) const
Definition: pos.cpp:143
bool operator!=(const pos &yRef) const
Definition: pos.cpp:84
float x
Definition: pos.h:9
int8_t lay
Definition: defines2D.h:8
vec3 pos3D() const
Definition: pos.cpp:527
float y
Definition: pos.h:9
pos()
Definition: pos.cpp:5
pos operator/(unsigned int n)
Definition: pos.cpp:227
const lay LAYER_DEF
Definition: defines2D.h:10
vec2 pos2D() const
Definition: pos.cpp:521
bool operator==(const pos &yRef) const
Definition: pos.cpp:69
pos operator-(const pos &yRef) const
Definition: pos.cpp:161
Definition: pos.h:7
pos & operator*=(unsigned int n)
Definition: pos.cpp:275
pos operator*(unsigned int n)
Definition: pos.cpp:179