OpenTTD Source: src/waypoint_cmd.h Source File

OpenTTD Source 15.0-RC2

waypoint_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 <https://www.gnu.org/licenses/old-licenses/gpl-2.0>.
6 */
7
10#ifndef WAYPOINT_CMD_H
11#define WAYPOINT_CMD_H
12
13#include "command_type.h"
14#include "station_type.h"
15
16enum StationClassID : uint16_t;
17enum RoadStopClassID : uint16_t;
18
19 CommandCost CmdBuildRailWaypoint(DoCommandFlags flags, TileIndex start_tile, Axis axis, uint8_t width, uint8_t height, StationClassID spec_class, uint16_t spec_index, StationID station_to_join, bool adjacent);
20 CommandCost CmdRemoveFromRailWaypoint(DoCommandFlags flags, TileIndex start, TileIndex end, bool keep_rail);
21 CommandCost CmdBuildRoadWaypoint(DoCommandFlags flags, TileIndex start_tile, Axis axis, uint8_t width, uint8_t height, RoadStopClassID spec_class, uint16_t spec_index, StationID station_to_join, bool adjacent);
22 CommandCost CmdRemoveFromRoadWaypoint(DoCommandFlags flags, TileIndex start, TileIndex end);
23 CommandCost CmdBuildBuoy(DoCommandFlags flags, TileIndex tile);
24 CommandCost CmdRenameWaypoint(DoCommandFlags flags, StationID waypoint_id, const std::string &text);
25std::tuple<CommandCost, StationID> CmdMoveWaypointName(DoCommandFlags flags, StationID waypoint_id, TileIndex tile);
26
27DEF_CMD_TRAIT(CMD_BUILD_RAIL_WAYPOINT, CmdBuildRailWaypoint, {}, CommandType::LandscapeConstruction)
28DEF_CMD_TRAIT(CMD_REMOVE_FROM_RAIL_WAYPOINT, CmdRemoveFromRailWaypoint, {}, CommandType::LandscapeConstruction)
29DEF_CMD_TRAIT(CMD_BUILD_ROAD_WAYPOINT, CmdBuildRoadWaypoint, {}, CommandType::LandscapeConstruction)
30DEF_CMD_TRAIT(CMD_REMOVE_FROM_ROAD_WAYPOINT, CmdRemoveFromRoadWaypoint, {}, CommandType::LandscapeConstruction)
31DEF_CMD_TRAIT(CMD_BUILD_BUOY, CmdBuildBuoy, CommandFlag::Auto, CommandType::LandscapeConstruction)
32DEF_CMD_TRAIT(CMD_RENAME_WAYPOINT, CmdRenameWaypoint, {}, CommandType::OtherManagement)
33DEF_CMD_TRAIT(CMD_MOVE_WAYPOINT_NAME, CmdMoveWaypointName, {}, CommandType::OtherManagement)
34
35void CcMoveWaypointName(Commands cmd, const CommandCost &result, StationID waypoint_id);
36
37#endif /* WAYPOINT_CMD_H */
CommandCost
Common return value for all commands.
Definition command_type.h:24
EnumBitSet
Enum-as-bit-set wrapper.
Definition enum_type.hpp:177
command_type.h
Types related to commands.
CommandType::OtherManagement
@ OtherManagement
Renaming stuff, changing company colours, placing signs, etc.
CommandType::LandscapeConstruction
@ LandscapeConstruction
Construction and destruction of objects on the map.
CommandFlag::Auto
@ Auto
set the DoCommandFlag::Auto flag on this command
Commands
Commands
List of commands.
Definition command_type.h:196
CMD_REMOVE_FROM_RAIL_WAYPOINT
@ CMD_REMOVE_FROM_RAIL_WAYPOINT
remove a (rectangle of) tiles from a rail waypoint
Definition command_type.h:218
CMD_BUILD_BUOY
@ CMD_BUILD_BUOY
build a buoy
Definition command_type.h:236
CMD_MOVE_WAYPOINT_NAME
@ CMD_MOVE_WAYPOINT_NAME
move a waypoint name
Definition command_type.h:217
CMD_BUILD_ROAD_WAYPOINT
@ CMD_BUILD_ROAD_WAYPOINT
build a road waypoint
Definition command_type.h:220
CMD_REMOVE_FROM_ROAD_WAYPOINT
@ CMD_REMOVE_FROM_ROAD_WAYPOINT
remove a (rectangle of) tiles from a road waypoint
Definition command_type.h:221
CMD_RENAME_WAYPOINT
@ CMD_RENAME_WAYPOINT
rename a waypoint
Definition command_type.h:216
CMD_BUILD_RAIL_WAYPOINT
@ CMD_BUILD_RAIL_WAYPOINT
build a waypoint
Definition command_type.h:215
Axis
Axis
Allow incrementing of DiagDirDiff variables.
Definition direction_type.h:123
RoadStopClassID
RoadStopClassID
Definition newgrf_roadstop.h:33
StationClassID
StationClassID
Definition newgrf_station.h:103
station_type.h
Types related to stations.
PoolID< uint16_t, struct StationIDTag, 64000, 0xFFFF >
StrongType::Typedef< uint32_t, struct TileIndexTag, StrongType::Compare, StrongType::Integer, StrongType::Compatible< int32_t >, StrongType::Compatible< int64_t > >
CmdBuildRoadWaypoint
CommandCost CmdBuildRoadWaypoint(DoCommandFlags flags, TileIndex start_tile, Axis axis, uint8_t width, uint8_t height, RoadStopClassID spec_class, uint16_t spec_index, StationID station_to_join, bool adjacent)
Build a road waypoint on an existing road.
Definition waypoint_cmd.cpp:341
CmdBuildRailWaypoint
CommandCost CmdBuildRailWaypoint(DoCommandFlags flags, TileIndex start_tile, Axis axis, uint8_t width, uint8_t height, StationClassID spec_class, uint16_t spec_index, StationID station_to_join, bool adjacent)
Convert existing rail to waypoint.
Definition waypoint_cmd.cpp:207
CcMoveWaypointName
void CcMoveWaypointName(Commands cmd, const CommandCost &result, StationID waypoint_id)
Callback function that is called after a name is moved.
Definition waypoint_cmd.cpp:657
CmdMoveWaypointName
std::tuple< CommandCost, StationID > CmdMoveWaypointName(DoCommandFlags flags, StationID waypoint_id, TileIndex tile)
Move a waypoint name.
Definition waypoint_cmd.cpp:620
CmdRemoveFromRailWaypoint
CommandCost CmdRemoveFromRailWaypoint(DoCommandFlags flags, TileIndex start, TileIndex end, bool keep_rail)
Remove a single tile from a waypoint.
Definition station_cmd.cpp:1874
CmdRemoveFromRoadWaypoint
CommandCost CmdRemoveFromRoadWaypoint(DoCommandFlags flags, TileIndex start, TileIndex end)
Remove road waypoints.
Definition station_cmd.cpp:2491
CmdRenameWaypoint
CommandCost CmdRenameWaypoint(DoCommandFlags flags, StationID waypoint_id, const std::string &text)
Rename a waypoint.
Definition waypoint_cmd.cpp:584
CmdBuildBuoy
CommandCost CmdBuildBuoy(DoCommandFlags flags, TileIndex tile)
Build a buoy.
Definition waypoint_cmd.cpp:474