Fix: Stopped ships shouldn't block depots (#8578)
[openttd-github.git] / src / goal_base.h
blobceeb0ef933a224c5c795bce0c40069482cfd6566
1 /*
2 * This file is part of OpenTTD.
3 * 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.
4 * 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.
5 * 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/>.
6 */
8 /** @file goal_base.h %Goal base class. */
10 #ifndef GOAL_BASE_H
11 #define GOAL_BASE_H
13 #include "company_type.h"
14 #include "goal_type.h"
15 #include "core/pool_type.hpp"
17 typedef Pool<Goal, GoalID, 64, 64000> GoalPool;
18 extern GoalPool _goal_pool;
20 /** Struct about goals, current and completed */
21 struct Goal : GoalPool::PoolItem<&_goal_pool> {
22 CompanyID company; ///< Goal is for a specific company; INVALID_COMPANY if it is global
23 GoalType type; ///< Type of the goal
24 GoalTypeID dst; ///< Index of type
25 char *text; ///< Text of the goal.
26 char *progress; ///< Progress text of the goal.
27 bool completed; ///< Is the goal completed or not?
29 /**
30 * We need an (empty) constructor so struct isn't zeroed (as C++ standard states)
32 inline Goal() { }
34 /**
35 * (Empty) destructor has to be defined else operator delete might be called with nullptr parameter
37 inline ~Goal() { free(this->text); free(this->progress); }
40 #endif /* GOAL_BASE_H */