Debian Codegraph @

engine/include/patch.h

raw
1 // ____ _ __
2 // / __ )____ _____ | | / /___ ___________
3 // / __ / __ \/ ___/ | | /| / / __ `/ ___/ ___/
4 // / /_/ / /_/ (__ ) | |/ |/ / /_/ / / (__ )
5 // /_____/\____/____/ |__/|__/\__,_/_/ /____/
6 //
7 // A futuristic real-time strategy game.
8 // This file is part of Bos Wars.
9 //
10 /**@name patch.h - The patch header. */
11 //
12 // (c) Copyright 2008 by Jimmy Salmon
13 //
14 // This program is free software; you can redistribute it and/or modify
15 // it under the terms of the GNU General Public License as published by
16 // the Free Software Foundation; only version 2 of the License.
17 //
18 // This program is distributed in the hope that it will be useful,
19 // but WITHOUT ANY WARRANTY; without even the implied warranty of
20 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 // GNU General Public License for more details.
22 //
23 // You should have received a copy of the GNU General Public License
24 // along with this program; if not, write to the Free Software
25 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
26 // 02111-1307, USA.
27
28 #ifndef _PATCH_H_
29 #define _PATCH_H_
30
31 //@{
32
33 class CPatchType;
34
35
36 class CPatch
37 {
38 public:
39 /**
40 ** Patch constructor
41 */
42 CPatch(CPatchType *type, int x, int y) :
43 type(type), x(x), y(y)
44 {
45 }
46
47 /**
48 ** Patch destructor
49 */
50 ~CPatch()
51 {
52 }
53
54 /**
55 ** Get the patch type
56 */
57 inline CPatchType *getType() const { return this->type; }
58
59 /**
60 ** Set the position of the patch
61 */
62 inline void setPos(int x, int y) { this->x = x; this->y = y; }
63
64 /**
65 ** Set the X position of the patch
66 */
67 inline void setX(int x) { this->x = x; }
68 /**
69 ** Get the X position of the patch
70 */
71 inline int getX() const { return this->x; }
72
73 /**
74 ** Set the Y position of the patch
75 */
76 inline void setY(int y) { this->y = y; }
77 /**
78 ** Get the Y position of the patch
79 */
80 inline int getY() const { return this->y; }
81
82 private:
83 CPatchType *type;
84 int x;
85 int y;
86 };
87
88 //@}
89
90 #endif /* _PATCH_H_ */
91