Constant object.
Definition at line 13 of file V2.h.
Public Member Functions | |
V2 (int x, int y) | |
int | getX () const |
int | getY () const |
V2 | plus (const V2 &other) const |
V2 | minus (const V2 &other) const |
V2 | scale (int rate) const |
V2 | shrink (int rate) const |
std::string | toString () const |
|
Definition at line 18 of file V2.h. 00018 { m_x = x; m_y = y; }
|
|
Definition at line 20 of file V2.h. 00020 { return m_x; }
|
|
Definition at line 21 of file V2.h. 00021 { return m_y; }
|
|
Definition at line 27 of file V2.h.
|
|
Definition at line 23 of file V2.h.
|
|
Definition at line 31 of file V2.h. 00032 { 00033 return V2(m_x * rate, m_y * rate); 00034 }
|
|
Definition at line 35 of file V2.h. 00036 { 00037 assert(rate != 0); 00038 return V2(m_x / rate, m_y / rate); 00039 }
|
|
Definition at line 41 of file V2.h. 00042 { 00043 return "[" + StringTool::toString(m_x) 00044 + "," + StringTool::toString(m_y) + "]"; 00045 }
|