OpenTTD
goal_base.h
Go to the documentation of this file.
1 /* $Id: goal_base.h 25299 2013-05-27 21:59:11Z zuu $ */
2 
3 /*
4  * This file is part of OpenTTD.
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.
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.
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/>.
8  */
9 
12 #ifndef GOAL_BASE_H
13 #define GOAL_BASE_H
14 
15 #include "company_type.h"
16 #include "goal_type.h"
17 #include "core/pool_type.hpp"
18 
20 extern GoalPool _goal_pool;
21 
23 struct Goal : GoalPool::PoolItem<&_goal_pool> {
27  char *text;
28  char *progress;
29  bool completed;
30 
34  inline Goal() { }
35 
39  inline ~Goal() { free(this->text); free(this->progress); }
40 };
41 
42 #define FOR_ALL_GOALS_FROM(var, start) FOR_ALL_ITEMS_FROM(Goal, goal_index, var, start)
43 #define FOR_ALL_GOALS(var) FOR_ALL_GOALS_FROM(var, 0)
44 
45 #endif /* GOAL_BASE_H */