The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
point.cpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2008 - 2016 by Mark de Wever <[email protected]>
3  Part of the Battle for Wesnoth Project http://www.wesnoth.org/
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY.
11 
12  See the COPYING file for more details.
13 */
14 
15 #define GETTEXT_DOMAIN "wesnoth-lib"
16 
17 #include "gui/core/point.hpp"
18 
19 #include <iostream>
20 
21 namespace gui2
22 {
23 
25 {
26  x += point.x;
27  y += point.y;
28  return *this;
29 }
30 
32 {
33  x -= point.x;
34  y -= point.y;
35  return *this;
36 }
37 
38 std::ostream& operator<<(std::ostream& stream, const tpoint& point)
39 {
40  stream << point.x << ',' << point.y;
41  return stream;
42 }
43 
44 } // namespace gui2
tpoint & operator-=(const tpoint &point)
Definition: point.cpp:31
GLint GLint GLint GLint GLint GLint y
Definition: glew.h:1220
A class inherited from ttext_box that displays its input as stars.
Definition: field-fwd.hpp:23
GLuint GLuint stream
Definition: glew.h:5239
int y
y coordinate.
Definition: point.hpp:34
std::ostream & operator<<(std::ostream &stream, const tpoint &point)
Definition: point.cpp:38
int x
x coordinate.
Definition: point.hpp:31
Holds a 2D point.
Definition: point.hpp:24
GLint GLint GLint GLint GLint x
Definition: glew.h:1220
tpoint & operator+=(const tpoint &point)
Definition: point.cpp:24