Mercurial > hg > openttd
annotate src/goal_base.h @ 20706:79930f9362c3 draft
-Change: [Win32] Position the IME composition window at the caret position.
author | Michael Lutz <michi@icosahedron.de> |
---|---|
date | Sun, 07 Apr 2013 17:10:38 +0200 |
parents | 1b8ebb17ed70 |
children |
rev | line source |
---|---|
18782
d14680ee0033
(svn r23630) -Add: a Goal GUI to show your current goals
truebrain <truebrain@openttd.org>
parents:
diff
changeset
|
1 /* $Id$ */ |
d14680ee0033
(svn r23630) -Add: a Goal GUI to show your current goals
truebrain <truebrain@openttd.org>
parents:
diff
changeset
|
2 |
d14680ee0033
(svn r23630) -Add: a Goal GUI to show your current goals
truebrain <truebrain@openttd.org>
parents:
diff
changeset
|
3 /* |
d14680ee0033
(svn r23630) -Add: a Goal GUI to show your current goals
truebrain <truebrain@openttd.org>
parents:
diff
changeset
|
4 * This file is part of OpenTTD. |
d14680ee0033
(svn r23630) -Add: a Goal GUI to show your current goals
truebrain <truebrain@openttd.org>
parents:
diff
changeset
|
5 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. |
d14680ee0033
(svn r23630) -Add: a Goal GUI to show your current goals
truebrain <truebrain@openttd.org>
parents:
diff
changeset
|
6 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
d14680ee0033
(svn r23630) -Add: a Goal GUI to show your current goals
truebrain <truebrain@openttd.org>
parents:
diff
changeset
|
7 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>. |
d14680ee0033
(svn r23630) -Add: a Goal GUI to show your current goals
truebrain <truebrain@openttd.org>
parents:
diff
changeset
|
8 */ |
d14680ee0033
(svn r23630) -Add: a Goal GUI to show your current goals
truebrain <truebrain@openttd.org>
parents:
diff
changeset
|
9 |
18855
a0d7e20ebafe
(svn r23704) -Doc: Doxygen comment fixes and additions.
alberth <alberth@openttd.org>
parents:
18850
diff
changeset
|
10 /** @file goal_base.h %Goal base class. */ |
18782
d14680ee0033
(svn r23630) -Add: a Goal GUI to show your current goals
truebrain <truebrain@openttd.org>
parents:
diff
changeset
|
11 |
d14680ee0033
(svn r23630) -Add: a Goal GUI to show your current goals
truebrain <truebrain@openttd.org>
parents:
diff
changeset
|
12 #ifndef GOAL_BASE_H |
d14680ee0033
(svn r23630) -Add: a Goal GUI to show your current goals
truebrain <truebrain@openttd.org>
parents:
diff
changeset
|
13 #define GOAL_BASE_H |
d14680ee0033
(svn r23630) -Add: a Goal GUI to show your current goals
truebrain <truebrain@openttd.org>
parents:
diff
changeset
|
14 |
d14680ee0033
(svn r23630) -Add: a Goal GUI to show your current goals
truebrain <truebrain@openttd.org>
parents:
diff
changeset
|
15 #include "company_type.h" |
d14680ee0033
(svn r23630) -Add: a Goal GUI to show your current goals
truebrain <truebrain@openttd.org>
parents:
diff
changeset
|
16 #include "goal_type.h" |
d14680ee0033
(svn r23630) -Add: a Goal GUI to show your current goals
truebrain <truebrain@openttd.org>
parents:
diff
changeset
|
17 #include "core/pool_type.hpp" |
d14680ee0033
(svn r23630) -Add: a Goal GUI to show your current goals
truebrain <truebrain@openttd.org>
parents:
diff
changeset
|
18 |
20347
1b8ebb17ed70
(svn r25299) -Feature: Allow more concurrent goals in a game
zuu <zuu@openttd.org>
parents:
20344
diff
changeset
|
19 typedef Pool<Goal, GoalID, 64, 64000> GoalPool; |
18782
d14680ee0033
(svn r23630) -Add: a Goal GUI to show your current goals
truebrain <truebrain@openttd.org>
parents:
diff
changeset
|
20 extern GoalPool _goal_pool; |
d14680ee0033
(svn r23630) -Add: a Goal GUI to show your current goals
truebrain <truebrain@openttd.org>
parents:
diff
changeset
|
21 |
20344
70f3ab64660a
(svn r25296) -Feature: Goals can now have a progress text and/or be marked as completed.
zuu <zuu@openttd.org>
parents:
18886
diff
changeset
|
22 /** Struct about goals, current and completed */ |
18782
d14680ee0033
(svn r23630) -Add: a Goal GUI to show your current goals
truebrain <truebrain@openttd.org>
parents:
diff
changeset
|
23 struct Goal : GoalPool::PoolItem<&_goal_pool> { |
d14680ee0033
(svn r23630) -Add: a Goal GUI to show your current goals
truebrain <truebrain@openttd.org>
parents:
diff
changeset
|
24 CompanyByte company; ///< Goal is for a specific company; INVALID_COMPANY if it is global |
d14680ee0033
(svn r23630) -Add: a Goal GUI to show your current goals
truebrain <truebrain@openttd.org>
parents:
diff
changeset
|
25 GoalTypeByte type; ///< Type of the goal |
d14680ee0033
(svn r23630) -Add: a Goal GUI to show your current goals
truebrain <truebrain@openttd.org>
parents:
diff
changeset
|
26 GoalTypeID dst; ///< Index of type |
d14680ee0033
(svn r23630) -Add: a Goal GUI to show your current goals
truebrain <truebrain@openttd.org>
parents:
diff
changeset
|
27 char *text; ///< Text of the goal. |
20344
70f3ab64660a
(svn r25296) -Feature: Goals can now have a progress text and/or be marked as completed.
zuu <zuu@openttd.org>
parents:
18886
diff
changeset
|
28 char *progress; ///< Progress text of the goal. |
70f3ab64660a
(svn r25296) -Feature: Goals can now have a progress text and/or be marked as completed.
zuu <zuu@openttd.org>
parents:
18886
diff
changeset
|
29 bool completed; ///< Is the goal completed or not? |
18782
d14680ee0033
(svn r23630) -Add: a Goal GUI to show your current goals
truebrain <truebrain@openttd.org>
parents:
diff
changeset
|
30 |
d14680ee0033
(svn r23630) -Add: a Goal GUI to show your current goals
truebrain <truebrain@openttd.org>
parents:
diff
changeset
|
31 /** |
d14680ee0033
(svn r23630) -Add: a Goal GUI to show your current goals
truebrain <truebrain@openttd.org>
parents:
diff
changeset
|
32 * We need an (empty) constructor so struct isn't zeroed (as C++ standard states) |
d14680ee0033
(svn r23630) -Add: a Goal GUI to show your current goals
truebrain <truebrain@openttd.org>
parents:
diff
changeset
|
33 */ |
18792
c99e695378ce
(svn r23640) -Fix: stop using FORCEINLINE (1/3rd of the instances were, the others were still regular inline), but make sure inline is always a 'forced' inline (I am looking at you MSVC)
truebrain <truebrain@openttd.org>
parents:
18782
diff
changeset
|
34 inline Goal() { } |
18782
d14680ee0033
(svn r23630) -Add: a Goal GUI to show your current goals
truebrain <truebrain@openttd.org>
parents:
diff
changeset
|
35 |
d14680ee0033
(svn r23630) -Add: a Goal GUI to show your current goals
truebrain <truebrain@openttd.org>
parents:
diff
changeset
|
36 /** |
d14680ee0033
(svn r23630) -Add: a Goal GUI to show your current goals
truebrain <truebrain@openttd.org>
parents:
diff
changeset
|
37 * (Empty) destructor has to be defined else operator delete might be called with NULL parameter |
d14680ee0033
(svn r23630) -Add: a Goal GUI to show your current goals
truebrain <truebrain@openttd.org>
parents:
diff
changeset
|
38 */ |
20344
70f3ab64660a
(svn r25296) -Feature: Goals can now have a progress text and/or be marked as completed.
zuu <zuu@openttd.org>
parents:
18886
diff
changeset
|
39 inline ~Goal() { free(this->text); free(this->progress); } |
18782
d14680ee0033
(svn r23630) -Add: a Goal GUI to show your current goals
truebrain <truebrain@openttd.org>
parents:
diff
changeset
|
40 }; |
d14680ee0033
(svn r23630) -Add: a Goal GUI to show your current goals
truebrain <truebrain@openttd.org>
parents:
diff
changeset
|
41 |
d14680ee0033
(svn r23630) -Add: a Goal GUI to show your current goals
truebrain <truebrain@openttd.org>
parents:
diff
changeset
|
42 #define FOR_ALL_GOALS_FROM(var, start) FOR_ALL_ITEMS_FROM(Goal, goal_index, var, start) |
d14680ee0033
(svn r23630) -Add: a Goal GUI to show your current goals
truebrain <truebrain@openttd.org>
parents:
diff
changeset
|
43 #define FOR_ALL_GOALS(var) FOR_ALL_GOALS_FROM(var, 0) |
d14680ee0033
(svn r23630) -Add: a Goal GUI to show your current goals
truebrain <truebrain@openttd.org>
parents:
diff
changeset
|
44 |
d14680ee0033
(svn r23630) -Add: a Goal GUI to show your current goals
truebrain <truebrain@openttd.org>
parents:
diff
changeset
|
45 #endif /* GOAL_BASE_H */ |