OpenTTD Source  20241121-master-g67a0fccfad
goal_base.h
Go to the documentation of this file.
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  */
7 
10 #ifndef GOAL_BASE_H
11 #define GOAL_BASE_H
12 
13 #include "company_type.h"
14 #include "goal_type.h"
15 #include "core/pool_type.hpp"
16 
18 extern GoalPool _goal_pool;
19 
21 struct Goal : GoalPool::PoolItem<&_goal_pool> {
25  std::string text;
26  std::string progress;
27  bool completed;
28 
32  inline Goal() { }
33 
37  inline ~Goal() { }
38 
39  static bool IsValidGoalDestination(CompanyID company, GoalType type, GoalTypeID dest);
40 };
41 
42 #endif /* GOAL_BASE_H */
Types related to companies.
Owner
Enum for all companies/owners.
Definition: company_type.h:18
basic types related to goals
GoalType
Types of goal destinations.
Definition: goal_type.h:26
uint32_t GoalTypeID
Contains either tile, industry ID, town ID, company ID, or story page ID.
Definition: goal_type.h:35
Definition of Pool, structure used to access PoolItems, and PoolItem, base structure for Vehicle,...
Struct about goals, current and completed.
Definition: goal_base.h:21
~Goal()
(Empty) destructor has to be defined else operator delete might be called with nullptr parameter
Definition: goal_base.h:37
bool completed
Is the goal completed or not?
Definition: goal_base.h:27
GoalType type
Type of the goal.
Definition: goal_base.h:23
GoalTypeID dst
Index of type.
Definition: goal_base.h:24
std::string text
Text of the goal.
Definition: goal_base.h:25
CompanyID company
Goal is for a specific company; INVALID_COMPANY if it is global.
Definition: goal_base.h:22
std::string progress
Progress text of the goal.
Definition: goal_base.h:26
Goal()
We need an (empty) constructor so struct isn't zeroed (as C++ standard states)
Definition: goal_base.h:32
Base class for all PoolItems.
Definition: pool_type.hpp:237
Base class for all pools.
Definition: pool_type.hpp:80