OpenTTD Source  14.0-beta1
goal_cmd.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_CMD_H
11 #define GOAL_CMD_H
12 
13 #include "command_type.h"
14 #include "goal_type.h"
15 
16 std::tuple<CommandCost, GoalID> CmdCreateGoal(DoCommandFlag flags, CompanyID company, GoalType type, GoalTypeID dest, const std::string &text);
19 CommandCost CmdSetGoalText(DoCommandFlag flags, GoalID goal, const std::string &text);
20 CommandCost CmdSetGoalProgress(DoCommandFlag flags, GoalID goal, const std::string &text);
21 CommandCost CmdSetGoalCompleted(DoCommandFlag flags, GoalID goal, bool completed);
22 CommandCost CmdGoalQuestion(DoCommandFlag flags, uint16_t uniqueid, uint32_t target, bool is_client, uint32_t button_mask, GoalQuestionType type, const std::string &text);
23 CommandCost CmdGoalQuestionAnswer(DoCommandFlag flags, uint16_t uniqueid, uint8_t button);
24 
33 
34 #endif /* GOAL_CMD_H */
CMD_REMOVE_GOAL
@ CMD_REMOVE_GOAL
remove a goal
Definition: command_type.h:299
CMD_SET_GOAL_PROGRESS
@ CMD_SET_GOAL_PROGRESS
update goal progress text of a goal
Definition: command_type.h:302
CMD_SET_GOAL_DESTINATION
@ CMD_SET_GOAL_DESTINATION
update goal destination of a goal
Definition: command_type.h:300
CMD_SET_GOAL_TEXT
@ CMD_SET_GOAL_TEXT
update goal text of a goal
Definition: command_type.h:301
goal_type.h
CMD_GOAL_QUESTION
@ CMD_GOAL_QUESTION
ask a goal related question
Definition: command_type.h:304
CmdSetGoalText
CommandCost CmdSetGoalText(DoCommandFlag flags, GoalID goal, const std::string &text)
Update goal text of a goal.
Definition: goal.cpp:165
Owner
Owner
Enum for all companies/owners.
Definition: company_type.h:18
DoCommandFlag
DoCommandFlag
List of flags for a command.
Definition: command_type.h:369
CMD_DEITY
@ CMD_DEITY
the command may be executed by COMPANY_DEITY
Definition: command_type.h:400
CmdSetGoalDestination
CommandCost CmdSetGoalDestination(DoCommandFlag flags, GoalID goal, GoalType type, GoalTypeID dest)
Update goal destination of a goal.
Definition: goal.cpp:143
CommandCost
Common return value for all commands.
Definition: command_type.h:23
CMDT_OTHER_MANAGEMENT
@ CMDT_OTHER_MANAGEMENT
Renaming stuff, changing company colours, placing signs, etc.
Definition: command_type.h:414
CmdGoalQuestionAnswer
CommandCost CmdGoalQuestionAnswer(DoCommandFlag flags, uint16_t uniqueid, uint8_t button)
Reply to a goal question.
Definition: goal.cpp:292
GoalTypeID
uint32_t GoalTypeID
Contains either tile, industry ID, town ID, company ID, or story page ID.
Definition: goal_type.h:35
CMD_GOAL_QUESTION_ANSWER
@ CMD_GOAL_QUESTION_ANSWER
answer(s) to CMD_GOAL_QUESTION
Definition: command_type.h:305
GoalID
uint16_t GoalID
ID of a goal.
Definition: goal_type.h:37
command_type.h
CMD_CREATE_GOAL
@ CMD_CREATE_GOAL
create a new goal
Definition: command_type.h:298
CmdRemoveGoal
CommandCost CmdRemoveGoal(DoCommandFlag flags, GoalID goal)
Remove a goal.
Definition: goal.cpp:114
CmdGoalQuestion
CommandCost CmdGoalQuestion(DoCommandFlag flags, uint16_t uniqueid, uint32_t target, bool is_client, uint32_t button_mask, GoalQuestionType type, const std::string &text)
Ask a goal related question.
Definition: goal.cpp:248
CmdSetGoalProgress
CommandCost CmdSetGoalProgress(DoCommandFlag flags, GoalID goal, const std::string &text)
Update progress text of a goal.
Definition: goal.cpp:192
CmdSetGoalCompleted
CommandCost CmdSetGoalCompleted(DoCommandFlag flags, GoalID goal, bool completed)
Update completed state of a goal.
Definition: goal.cpp:218
CMD_SET_GOAL_COMPLETED
@ CMD_SET_GOAL_COMPLETED
update goal completed status of a goal
Definition: command_type.h:303
GoalType
GoalType
Types of goal destinations.
Definition: goal_type.h:26
CMD_STR_CTRL
@ CMD_STR_CTRL
the command's string may contain control strings
Definition: command_type.h:401
CmdCreateGoal
std::tuple< CommandCost, GoalID > CmdCreateGoal(DoCommandFlag flags, CompanyID company, GoalType type, GoalTypeID dest, const std::string &text)
Create a new goal.
Definition: goal.cpp:78