diff --git a/cm_changelog.txt b/cm_changelog.txt index e0c5cae51c..88b7e3758a 100644 --- a/cm_changelog.txt +++ b/cm_changelog.txt @@ -74,7 +74,21 @@ This is usable for any OpenTTD servers == CHANGELOG == -*** ??? *** +*** 13.1 (10 Apr 2022) *** +- Show building preview when funding industries. +- Show industry production on the minimap on high zoom levels in IMBA mode. +- Added two more zoom levels to the minimap. +- Improved performance of the UI for about 20% (ported from JGRPP). +- Show cargo and industry type IDs in industry chains window in developer mode. +- Added cmgamestats console command to show the total number of vehicles in the game. +- Added a server lag counter in the status bar (when show APM is enabled). +- Improved how regular advertisement tracks stations. +- Fixed crash when moving station blueprint outside the map area. +- Fixed crash in polyrail terraforming mode (#15) +- Fixed clients overlay +- Fixed shaded trees and graph background settings not being available in multiplayer. + +*** 13.0 (21 Feb 2023) *** - Added a hotkey to switch industry layouts when funding (MMB by default). - Fixed crash when no graphics were installed. - Fixed company selection when clicking in online players window. diff --git a/gen_commands.py b/gen_commands.py index 4ac35fe12e..ca98efa82c 100644 --- a/gen_commands.py +++ b/gen_commands.py @@ -121,14 +121,14 @@ def parse_commands(): result_type = None args = [RX_ARG.fullmatch(x).group('type', 'name') for x in args_str.split(', ')] args = args[1:] # flags - first_tile_arg = (args[0][0].strip() == 'TileIndex') - if first_tile_arg: - args = args[1:] for i, (at, an) in enumerate(args): at = at.strip() if at in GLOBAL_TYPES: at = '::' + at args[i] = (at, an) + do_args = args[:] + if 'CMD_LOCATION' in flags: + args = [('TileIndex', 'location')] + args print(cid, constant, category, args) callback_args = 'CommandCost' if result_type is None else f'CommandCost, {result_type}' callback_type = f'std::function' @@ -151,7 +151,7 @@ def parse_commands(): 'flags': flags, 'default_run_as': default_run_as, 'args': args, - 'first_tile_arg': first_tile_arg, + 'do_args': do_args, 'returns': returns, 'result_type': result_type, 'callback_type': callback_type, @@ -190,8 +190,8 @@ static size_t FindCallbackIndex(::CommandCallback *callback) { } template -bool _DoPost(StringID err_msg, TileIndex tile, Targs... args) { - return ::Command::Post(err_msg, std::get(_callback_tuple), tile, std::forward(args)...); +bool _DoPost(StringID err_msg, Targs... args) { + return ::Command::Post(err_msg, std::get(_callback_tuple), std::forward(args)...); } template constexpr auto MakeCallback() noexcept { @@ -210,7 +210,7 @@ constexpr auto MakeCallback() noexcept { template inline constexpr auto MakeDispatchTableHelper(std::index_sequence) noexcept { - return std::array{MakeCallback()... }; + return std::array{MakeCallback()... }; } template @@ -261,12 +261,6 @@ def run(): else: f.write(f' {name}({args_list}) {{}}\n') - if cmd.get('first_tile_arg'): - separator = ', ' if args_list else '' - f.write( - f' {name}(TileIndex tile{separator}{args_list})\n' - f' :Command{{tile}}{separator}{args_init} {{}}\n' - ) f.write( f' ~{name}() override {{}}\n' f'\n' @@ -313,13 +307,7 @@ def run(): this_args_list = ', '.join(f'this->{an}' for _, an in cmd['args']) args_list = ', '.join(f'{an}' for _, an in cmd['args']) args_type_list = ', '.join(f'{at}' for at, an in cmd['args']) - test_args_list = args_list - if cmd.get('first_tile_arg'): - if args_list: - test_args_list = f'this->tile, ' + args_list - else: - test_args_list = f'this->tile' - + test_args_list = ', '.join(f'{an}' for _, an in cmd['do_args']) cost_getter = '' if cmd['result_type'] is None else 'std::get<0>' sep_args_list = sep_args_type_list = sep_this_args_list = '' if args_list: @@ -330,7 +318,7 @@ def run(): f'Commands {name}::get_command() {{ return {constant}; }}\n' f'static constexpr auto _{name}_dispatch = MakeDispatchTable<{constant}{sep_args_type_list}>();\n' f'bool {name}::_post(::CommandCallback *callback) {{\n' - f' return _{name}_dispatch[FindCallbackIndex(callback)](this->error, this->tile{sep_this_args_list});\n' + f' return _{name}_dispatch[FindCallbackIndex(callback)](this->error{sep_this_args_list});\n' '}\n' f'CommandCost {name}::_do(DoCommandFlag flags) {{\n' f' return {cost_getter}(::Command<{constant}>::Do(flags, {test_args_list}));\n' diff --git a/src/citymania/cm_command_log.cpp b/src/citymania/cm_command_log.cpp index c1d65fa894..c2ae2626ee 100644 --- a/src/citymania/cm_command_log.cpp +++ b/src/citymania/cm_command_log.cpp @@ -60,7 +60,7 @@ void ExecuteFakeCommands(Date date, DateFract date_fract) { while (!_fake_commands.empty() && !DatePredate(date, date_fract, _fake_commands.front().date, _fake_commands.front().date_fract)) { auto &x = _fake_commands.front(); - fprintf(stderr, "Executing command: %s(%u) company=%u tile=%u ... ", GetCommandName(x.cp.cmd), x.cp.cmd, x.cp.company, (uint)x.cp.tile); + fprintf(stderr, "Executing command: %s(%u) company=%u ... ", GetCommandName(x.cp.cmd), x.cp.cmd, x.cp.company); if (x.res == 0) { fprintf(stderr, "REJECTED\n"); _fake_commands.pop(); @@ -166,7 +166,7 @@ void load_replay_commands(const std::string &filename, std::functioncall(DC_NONE); } - Command &with_tile(TileIndex tile) { - this->tile = tile; - return *this; - } - Command &with_error(StringID error) { this->error = error; return *this; diff --git a/src/citymania/cm_commands.cpp b/src/citymania/cm_commands.cpp index cc32ea4eca..03dbbea3be 100644 --- a/src/citymania/cm_commands.cpp +++ b/src/citymania/cm_commands.cpp @@ -89,9 +89,9 @@ namespace std { } // namespace std namespace citymania { -size_t GetCommandHash(Commands cmd, CompanyID company_id, StringID err_msg, ::CommandCallback callback, TileIndex tile, const CommandDataBuffer &data) { +size_t GetCommandHash(Commands cmd, CompanyID company_id, StringID err_msg, ::CommandCallback callback, const CommandDataBuffer &data) { size_t res = 0; - hash_combine(res, cmd, (uint16)company_id, err_msg, callback, (uint32)tile, data); + hash_combine(res, cmd, (uint16)company_id, err_msg, callback, data); return res; } @@ -105,7 +105,7 @@ void ExecuteCurrentCallback(const CommandCost &cost) { void BeforeNetworkCommandExecution(const CommandPacket* cp) { if (!cp->my_cmd) return; - size_t hash = GetCommandHash(cp->cmd, cp->company, cp->err_msg, cp->callback, cp->tile, cp->data); + size_t hash = GetCommandHash(cp->cmd, cp->company, cp->err_msg, cp->callback, cp->data); Debug(misc, 5, "CM BeforeNetworkCommandExecution: cmd={} hash={}", cp->cmd, hash); while (!_callback_queue.empty() && _callback_queue.front().hash != hash) { Debug(misc, 0, "CM Dismissing command from callback queue: hash={}", _callback_queue.front().hash); @@ -128,7 +128,7 @@ void AfterNetworkCommandExecution(const CommandPacket* cp) { } void AddCommandCallback(const CommandPacket *cp) { - size_t hash = GetCommandHash(cp->cmd, cp->company, cp->err_msg, cp->callback, cp->tile, cp->data); + size_t hash = GetCommandHash(cp->cmd, cp->company, cp->err_msg, cp->callback, cp->data); Debug(misc, 5, "CM Added callback: cmd={} hash={}", cp->cmd, hash); _callback_queue.emplace(hash, _current_callback); _current_callback = nullptr; diff --git a/src/citymania/generated/cm_gen_commands.cpp b/src/citymania/generated/cm_gen_commands.cpp index 3372a79631..940bf37e6a 100644 --- a/src/citymania/generated/cm_gen_commands.cpp +++ b/src/citymania/generated/cm_gen_commands.cpp @@ -76,8 +76,8 @@ static size_t FindCallbackIndex(::CommandCallback *callback) { } template -bool _DoPost(StringID err_msg, TileIndex tile, Targs... args) { - return ::Command::Post(err_msg, std::get(_callback_tuple), tile, std::forward(args)...); +bool _DoPost(StringID err_msg, Targs... args) { + return ::Command::Post(err_msg, std::get(_callback_tuple), std::forward(args)...); } template constexpr auto MakeCallback() noexcept { @@ -96,7 +96,7 @@ constexpr auto MakeCallback() noexcept { template inline constexpr auto MakeDispatchTableHelper(std::index_sequence) noexcept { - return std::array{MakeCallback()... }; + return std::array{MakeCallback()... }; } template @@ -108,34 +108,34 @@ inline constexpr auto MakeDispatchTable() noexcept Commands CreateStoryPage::get_command() { return CMD_CREATE_STORY_PAGE; } static constexpr auto _CreateStoryPage_dispatch = MakeDispatchTable(); bool CreateStoryPage::_post(::CommandCallback *callback) { - return _CreateStoryPage_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->company, this->text); + return _CreateStoryPage_dispatch[FindCallbackIndex(callback)](this->error, this->company, this->text); } CommandCost CreateStoryPage::_do(DoCommandFlag flags) { return std::get<0>(::Command::Do(flags, company, text)); } Commands CreateStoryPageElement::get_command() { return CMD_CREATE_STORY_PAGE_ELEMENT; } -static constexpr auto _CreateStoryPageElement_dispatch = MakeDispatchTable(); +static constexpr auto _CreateStoryPageElement_dispatch = MakeDispatchTable(); bool CreateStoryPageElement::_post(::CommandCallback *callback) { return _CreateStoryPageElement_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->page_id, this->type, this->reference, this->text); } CommandCost CreateStoryPageElement::_do(DoCommandFlag flags) { - return std::get<0>(::Command::Do(flags, this->tile, page_id, type, reference, text)); + return std::get<0>(::Command::Do(flags, tile, page_id, type, reference, text)); } Commands UpdateStoryPageElement::get_command() { return CMD_UPDATE_STORY_PAGE_ELEMENT; } -static constexpr auto _UpdateStoryPageElement_dispatch = MakeDispatchTable(); +static constexpr auto _UpdateStoryPageElement_dispatch = MakeDispatchTable(); bool UpdateStoryPageElement::_post(::CommandCallback *callback) { return _UpdateStoryPageElement_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->page_element_id, this->reference, this->text); } CommandCost UpdateStoryPageElement::_do(DoCommandFlag flags) { - return (::Command::Do(flags, this->tile, page_element_id, reference, text)); + return (::Command::Do(flags, tile, page_element_id, reference, text)); } Commands SetStoryPageTitle::get_command() { return CMD_SET_STORY_PAGE_TITLE; } static constexpr auto _SetStoryPageTitle_dispatch = MakeDispatchTable(); bool SetStoryPageTitle::_post(::CommandCallback *callback) { - return _SetStoryPageTitle_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->page_id, this->text); + return _SetStoryPageTitle_dispatch[FindCallbackIndex(callback)](this->error, this->page_id, this->text); } CommandCost SetStoryPageTitle::_do(DoCommandFlag flags) { return (::Command::Do(flags, page_id, text)); @@ -144,7 +144,7 @@ CommandCost SetStoryPageTitle::_do(DoCommandFlag flags) { Commands SetStoryPageDate::get_command() { return CMD_SET_STORY_PAGE_DATE; } static constexpr auto _SetStoryPageDate_dispatch = MakeDispatchTable(); bool SetStoryPageDate::_post(::CommandCallback *callback) { - return _SetStoryPageDate_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->page_id, this->date); + return _SetStoryPageDate_dispatch[FindCallbackIndex(callback)](this->error, this->page_id, this->date); } CommandCost SetStoryPageDate::_do(DoCommandFlag flags) { return (::Command::Do(flags, page_id, date)); @@ -153,7 +153,7 @@ CommandCost SetStoryPageDate::_do(DoCommandFlag flags) { Commands ShowStoryPage::get_command() { return CMD_SHOW_STORY_PAGE; } static constexpr auto _ShowStoryPage_dispatch = MakeDispatchTable(); bool ShowStoryPage::_post(::CommandCallback *callback) { - return _ShowStoryPage_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->page_id); + return _ShowStoryPage_dispatch[FindCallbackIndex(callback)](this->error, this->page_id); } CommandCost ShowStoryPage::_do(DoCommandFlag flags) { return (::Command::Do(flags, page_id)); @@ -162,7 +162,7 @@ CommandCost ShowStoryPage::_do(DoCommandFlag flags) { Commands RemoveStoryPage::get_command() { return CMD_REMOVE_STORY_PAGE; } static constexpr auto _RemoveStoryPage_dispatch = MakeDispatchTable(); bool RemoveStoryPage::_post(::CommandCallback *callback) { - return _RemoveStoryPage_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->page_id); + return _RemoveStoryPage_dispatch[FindCallbackIndex(callback)](this->error, this->page_id); } CommandCost RemoveStoryPage::_do(DoCommandFlag flags) { return (::Command::Do(flags, page_id)); @@ -171,115 +171,115 @@ CommandCost RemoveStoryPage::_do(DoCommandFlag flags) { Commands RemoveStoryPageElement::get_command() { return CMD_REMOVE_STORY_PAGE_ELEMENT; } static constexpr auto _RemoveStoryPageElement_dispatch = MakeDispatchTable(); bool RemoveStoryPageElement::_post(::CommandCallback *callback) { - return _RemoveStoryPageElement_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->page_element_id); + return _RemoveStoryPageElement_dispatch[FindCallbackIndex(callback)](this->error, this->page_element_id); } CommandCost RemoveStoryPageElement::_do(DoCommandFlag flags) { return (::Command::Do(flags, page_element_id)); } Commands StoryPageButton::get_command() { return CMD_STORY_PAGE_BUTTON; } -static constexpr auto _StoryPageButton_dispatch = MakeDispatchTable(); +static constexpr auto _StoryPageButton_dispatch = MakeDispatchTable(); bool StoryPageButton::_post(::CommandCallback *callback) { return _StoryPageButton_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->page_element_id, this->reference); } CommandCost StoryPageButton::_do(DoCommandFlag flags) { - return (::Command::Do(flags, this->tile, page_element_id, reference)); + return (::Command::Do(flags, tile, page_element_id, reference)); } Commands BuildRailWaypoint::get_command() { return CMD_BUILD_RAIL_WAYPOINT; } -static constexpr auto _BuildRailWaypoint_dispatch = MakeDispatchTable(); +static constexpr auto _BuildRailWaypoint_dispatch = MakeDispatchTable(); bool BuildRailWaypoint::_post(::CommandCallback *callback) { - return _BuildRailWaypoint_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->axis, this->width, this->height, this->spec_class, this->spec_index, this->station_to_join, this->adjacent); + return _BuildRailWaypoint_dispatch[FindCallbackIndex(callback)](this->error, this->start_tile, this->axis, this->width, this->height, this->spec_class, this->spec_index, this->station_to_join, this->adjacent); } CommandCost BuildRailWaypoint::_do(DoCommandFlag flags) { - return (::Command::Do(flags, this->tile, axis, width, height, spec_class, spec_index, station_to_join, adjacent)); + return (::Command::Do(flags, start_tile, axis, width, height, spec_class, spec_index, station_to_join, adjacent)); } Commands RemoveFromRailWaypoint::get_command() { return CMD_REMOVE_FROM_RAIL_WAYPOINT; } -static constexpr auto _RemoveFromRailWaypoint_dispatch = MakeDispatchTable(); +static constexpr auto _RemoveFromRailWaypoint_dispatch = MakeDispatchTable(); bool RemoveFromRailWaypoint::_post(::CommandCallback *callback) { - return _RemoveFromRailWaypoint_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->end, this->keep_rail); + return _RemoveFromRailWaypoint_dispatch[FindCallbackIndex(callback)](this->error, this->start, this->end, this->keep_rail); } CommandCost RemoveFromRailWaypoint::_do(DoCommandFlag flags) { - return (::Command::Do(flags, this->tile, end, keep_rail)); + return (::Command::Do(flags, start, end, keep_rail)); } Commands BuildBuoy::get_command() { return CMD_BUILD_BUOY; } -static constexpr auto _BuildBuoy_dispatch = MakeDispatchTable(); +static constexpr auto _BuildBuoy_dispatch = MakeDispatchTable(); bool BuildBuoy::_post(::CommandCallback *callback) { return _BuildBuoy_dispatch[FindCallbackIndex(callback)](this->error, this->tile); } CommandCost BuildBuoy::_do(DoCommandFlag flags) { - return (::Command::Do(flags, this->tile)); + return (::Command::Do(flags, tile)); } Commands RenameWaypoint::get_command() { return CMD_RENAME_WAYPOINT; } static constexpr auto _RenameWaypoint_dispatch = MakeDispatchTable(); bool RenameWaypoint::_post(::CommandCallback *callback) { - return _RenameWaypoint_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->waypoint_id, this->text); + return _RenameWaypoint_dispatch[FindCallbackIndex(callback)](this->error, this->waypoint_id, this->text); } CommandCost RenameWaypoint::_do(DoCommandFlag flags) { return (::Command::Do(flags, waypoint_id, text)); } Commands BuildAirport::get_command() { return CMD_BUILD_AIRPORT; } -static constexpr auto _BuildAirport_dispatch = MakeDispatchTable(); +static constexpr auto _BuildAirport_dispatch = MakeDispatchTable(); bool BuildAirport::_post(::CommandCallback *callback) { return _BuildAirport_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->airport_type, this->layout, this->station_to_join, this->adjacent); } CommandCost BuildAirport::_do(DoCommandFlag flags) { - return (::Command::Do(flags, this->tile, airport_type, layout, station_to_join, adjacent)); + return (::Command::Do(flags, tile, airport_type, layout, station_to_join, adjacent)); } Commands BuildDock::get_command() { return CMD_BUILD_DOCK; } -static constexpr auto _BuildDock_dispatch = MakeDispatchTable(); +static constexpr auto _BuildDock_dispatch = MakeDispatchTable(); bool BuildDock::_post(::CommandCallback *callback) { return _BuildDock_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->station_to_join, this->adjacent); } CommandCost BuildDock::_do(DoCommandFlag flags) { - return (::Command::Do(flags, this->tile, station_to_join, adjacent)); + return (::Command::Do(flags, tile, station_to_join, adjacent)); } Commands BuildRailStation::get_command() { return CMD_BUILD_RAIL_STATION; } -static constexpr auto _BuildRailStation_dispatch = MakeDispatchTable(); +static constexpr auto _BuildRailStation_dispatch = MakeDispatchTable(); bool BuildRailStation::_post(::CommandCallback *callback) { - return _BuildRailStation_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->rt, this->axis, this->numtracks, this->plat_len, this->spec_class, this->spec_index, this->station_to_join, this->adjacent); + return _BuildRailStation_dispatch[FindCallbackIndex(callback)](this->error, this->tile_org, this->rt, this->axis, this->numtracks, this->plat_len, this->spec_class, this->spec_index, this->station_to_join, this->adjacent); } CommandCost BuildRailStation::_do(DoCommandFlag flags) { - return (::Command::Do(flags, this->tile, rt, axis, numtracks, plat_len, spec_class, spec_index, station_to_join, adjacent)); + return (::Command::Do(flags, tile_org, rt, axis, numtracks, plat_len, spec_class, spec_index, station_to_join, adjacent)); } Commands RemoveFromRailStation::get_command() { return CMD_REMOVE_FROM_RAIL_STATION; } -static constexpr auto _RemoveFromRailStation_dispatch = MakeDispatchTable(); +static constexpr auto _RemoveFromRailStation_dispatch = MakeDispatchTable(); bool RemoveFromRailStation::_post(::CommandCallback *callback) { - return _RemoveFromRailStation_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->end, this->keep_rail); + return _RemoveFromRailStation_dispatch[FindCallbackIndex(callback)](this->error, this->start, this->end, this->keep_rail); } CommandCost RemoveFromRailStation::_do(DoCommandFlag flags) { - return (::Command::Do(flags, this->tile, end, keep_rail)); + return (::Command::Do(flags, start, end, keep_rail)); } Commands BuildRoadStop::get_command() { return CMD_BUILD_ROAD_STOP; } -static constexpr auto _BuildRoadStop_dispatch = MakeDispatchTable(); +static constexpr auto _BuildRoadStop_dispatch = MakeDispatchTable(); bool BuildRoadStop::_post(::CommandCallback *callback) { return _BuildRoadStop_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->width, this->length, this->stop_type, this->is_drive_through, this->ddir, this->rt, this->station_to_join, this->adjacent); } CommandCost BuildRoadStop::_do(DoCommandFlag flags) { - return (::Command::Do(flags, this->tile, width, length, stop_type, is_drive_through, ddir, rt, station_to_join, adjacent)); + return (::Command::Do(flags, tile, width, length, stop_type, is_drive_through, ddir, rt, station_to_join, adjacent)); } Commands RemoveRoadStop::get_command() { return CMD_REMOVE_ROAD_STOP; } -static constexpr auto _RemoveRoadStop_dispatch = MakeDispatchTable(); +static constexpr auto _RemoveRoadStop_dispatch = MakeDispatchTable(); bool RemoveRoadStop::_post(::CommandCallback *callback) { return _RemoveRoadStop_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->width, this->height, this->stop_type, this->remove_road); } CommandCost RemoveRoadStop::_do(DoCommandFlag flags) { - return (::Command::Do(flags, this->tile, width, height, stop_type, remove_road)); + return (::Command::Do(flags, tile, width, height, stop_type, remove_road)); } Commands RenameStation::get_command() { return CMD_RENAME_STATION; } static constexpr auto _RenameStation_dispatch = MakeDispatchTable(); bool RenameStation::_post(::CommandCallback *callback) { - return _RenameStation_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->station_id, this->text); + return _RenameStation_dispatch[FindCallbackIndex(callback)](this->error, this->station_id, this->text); } CommandCost RenameStation::_do(DoCommandFlag flags) { return (::Command::Do(flags, station_id, text)); @@ -288,7 +288,7 @@ CommandCost RenameStation::_do(DoCommandFlag flags) { Commands OpenCloseAirport::get_command() { return CMD_OPEN_CLOSE_AIRPORT; } static constexpr auto _OpenCloseAirport_dispatch = MakeDispatchTable(); bool OpenCloseAirport::_post(::CommandCallback *callback) { - return _OpenCloseAirport_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->station_id); + return _OpenCloseAirport_dispatch[FindCallbackIndex(callback)](this->error, this->station_id); } CommandCost OpenCloseAirport::_do(DoCommandFlag flags) { return (::Command::Do(flags, station_id)); @@ -297,7 +297,7 @@ CommandCost OpenCloseAirport::_do(DoCommandFlag flags) { Commands CreateGoal::get_command() { return CMD_CREATE_GOAL; } static constexpr auto _CreateGoal_dispatch = MakeDispatchTable(); bool CreateGoal::_post(::CommandCallback *callback) { - return _CreateGoal_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->company, this->type, this->dest, this->text); + return _CreateGoal_dispatch[FindCallbackIndex(callback)](this->error, this->company, this->type, this->dest, this->text); } CommandCost CreateGoal::_do(DoCommandFlag flags) { return std::get<0>(::Command::Do(flags, company, type, dest, text)); @@ -306,7 +306,7 @@ CommandCost CreateGoal::_do(DoCommandFlag flags) { Commands RemoveGoal::get_command() { return CMD_REMOVE_GOAL; } static constexpr auto _RemoveGoal_dispatch = MakeDispatchTable(); bool RemoveGoal::_post(::CommandCallback *callback) { - return _RemoveGoal_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->goal); + return _RemoveGoal_dispatch[FindCallbackIndex(callback)](this->error, this->goal); } CommandCost RemoveGoal::_do(DoCommandFlag flags) { return (::Command::Do(flags, goal)); @@ -315,7 +315,7 @@ CommandCost RemoveGoal::_do(DoCommandFlag flags) { Commands SetGoalText::get_command() { return CMD_SET_GOAL_TEXT; } static constexpr auto _SetGoalText_dispatch = MakeDispatchTable(); bool SetGoalText::_post(::CommandCallback *callback) { - return _SetGoalText_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->goal, this->text); + return _SetGoalText_dispatch[FindCallbackIndex(callback)](this->error, this->goal, this->text); } CommandCost SetGoalText::_do(DoCommandFlag flags) { return (::Command::Do(flags, goal, text)); @@ -324,7 +324,7 @@ CommandCost SetGoalText::_do(DoCommandFlag flags) { Commands SetGoalProgress::get_command() { return CMD_SET_GOAL_PROGRESS; } static constexpr auto _SetGoalProgress_dispatch = MakeDispatchTable(); bool SetGoalProgress::_post(::CommandCallback *callback) { - return _SetGoalProgress_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->goal, this->text); + return _SetGoalProgress_dispatch[FindCallbackIndex(callback)](this->error, this->goal, this->text); } CommandCost SetGoalProgress::_do(DoCommandFlag flags) { return (::Command::Do(flags, goal, text)); @@ -333,7 +333,7 @@ CommandCost SetGoalProgress::_do(DoCommandFlag flags) { Commands SetGoalCompleted::get_command() { return CMD_SET_GOAL_COMPLETED; } static constexpr auto _SetGoalCompleted_dispatch = MakeDispatchTable(); bool SetGoalCompleted::_post(::CommandCallback *callback) { - return _SetGoalCompleted_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->goal, this->completed); + return _SetGoalCompleted_dispatch[FindCallbackIndex(callback)](this->error, this->goal, this->completed); } CommandCost SetGoalCompleted::_do(DoCommandFlag flags) { return (::Command::Do(flags, goal, completed)); @@ -342,7 +342,7 @@ CommandCost SetGoalCompleted::_do(DoCommandFlag flags) { Commands GoalQuestion::get_command() { return CMD_GOAL_QUESTION; } static constexpr auto _GoalQuestion_dispatch = MakeDispatchTable(); bool GoalQuestion::_post(::CommandCallback *callback) { - return _GoalQuestion_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->uniqueid, this->target, this->is_client, this->button_mask, this->type, this->text); + return _GoalQuestion_dispatch[FindCallbackIndex(callback)](this->error, this->uniqueid, this->target, this->is_client, this->button_mask, this->type, this->text); } CommandCost GoalQuestion::_do(DoCommandFlag flags) { return (::Command::Do(flags, uniqueid, target, is_client, button_mask, type, text)); @@ -351,7 +351,7 @@ CommandCost GoalQuestion::_do(DoCommandFlag flags) { Commands GoalQuestionAnswer::get_command() { return CMD_GOAL_QUESTION_ANSWER; } static constexpr auto _GoalQuestionAnswer_dispatch = MakeDispatchTable(); bool GoalQuestionAnswer::_post(::CommandCallback *callback) { - return _GoalQuestionAnswer_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->uniqueid, this->button); + return _GoalQuestionAnswer_dispatch[FindCallbackIndex(callback)](this->error, this->uniqueid, this->button); } CommandCost GoalQuestionAnswer::_do(DoCommandFlag flags) { return (::Command::Do(flags, uniqueid, button)); @@ -360,7 +360,7 @@ CommandCost GoalQuestionAnswer::_do(DoCommandFlag flags) { Commands ChangeSetting::get_command() { return CMD_CHANGE_SETTING; } static constexpr auto _ChangeSetting_dispatch = MakeDispatchTable(); bool ChangeSetting::_post(::CommandCallback *callback) { - return _ChangeSetting_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->name, this->value); + return _ChangeSetting_dispatch[FindCallbackIndex(callback)](this->error, this->name, this->value); } CommandCost ChangeSetting::_do(DoCommandFlag flags) { return (::Command::Do(flags, name, value)); @@ -369,7 +369,7 @@ CommandCost ChangeSetting::_do(DoCommandFlag flags) { Commands ChangeCompanySetting::get_command() { return CMD_CHANGE_COMPANY_SETTING; } static constexpr auto _ChangeCompanySetting_dispatch = MakeDispatchTable(); bool ChangeCompanySetting::_post(::CommandCallback *callback) { - return _ChangeCompanySetting_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->name, this->value); + return _ChangeCompanySetting_dispatch[FindCallbackIndex(callback)](this->error, this->name, this->value); } CommandCost ChangeCompanySetting::_do(DoCommandFlag flags) { return (::Command::Do(flags, name, value)); @@ -378,106 +378,106 @@ CommandCost ChangeCompanySetting::_do(DoCommandFlag flags) { Commands CustomNewsItem::get_command() { return CMD_CUSTOM_NEWS_ITEM; } static constexpr auto _CustomNewsItem_dispatch = MakeDispatchTable(); bool CustomNewsItem::_post(::CommandCallback *callback) { - return _CustomNewsItem_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->type, this->reftype1, this->company, this->reference, this->text); + return _CustomNewsItem_dispatch[FindCallbackIndex(callback)](this->error, this->type, this->reftype1, this->company, this->reference, this->text); } CommandCost CustomNewsItem::_do(DoCommandFlag flags) { return (::Command::Do(flags, type, reftype1, company, reference, text)); } Commands BuildObject::get_command() { return CMD_BUILD_OBJECT; } -static constexpr auto _BuildObject_dispatch = MakeDispatchTable(); +static constexpr auto _BuildObject_dispatch = MakeDispatchTable(); bool BuildObject::_post(::CommandCallback *callback) { return _BuildObject_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->type, this->view); } CommandCost BuildObject::_do(DoCommandFlag flags) { - return (::Command::Do(flags, this->tile, type, view)); + return (::Command::Do(flags, tile, type, view)); } Commands BuildObjectArea::get_command() { return CMD_BUILD_OBJECT_AREA; } -static constexpr auto _BuildObjectArea_dispatch = MakeDispatchTable(); +static constexpr auto _BuildObjectArea_dispatch = MakeDispatchTable(); bool BuildObjectArea::_post(::CommandCallback *callback) { return _BuildObjectArea_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->start_tile, this->type, this->view, this->diagonal); } CommandCost BuildObjectArea::_do(DoCommandFlag flags) { - return (::Command::Do(flags, this->tile, start_tile, type, view, diagonal)); + return (::Command::Do(flags, tile, start_tile, type, view, diagonal)); } Commands BuildShipDepot::get_command() { return CMD_BUILD_SHIP_DEPOT; } -static constexpr auto _BuildShipDepot_dispatch = MakeDispatchTable(); +static constexpr auto _BuildShipDepot_dispatch = MakeDispatchTable(); bool BuildShipDepot::_post(::CommandCallback *callback) { return _BuildShipDepot_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->axis); } CommandCost BuildShipDepot::_do(DoCommandFlag flags) { - return (::Command::Do(flags, this->tile, axis)); + return (::Command::Do(flags, tile, axis)); } Commands BuildCanal::get_command() { return CMD_BUILD_CANAL; } -static constexpr auto _BuildCanal_dispatch = MakeDispatchTable(); +static constexpr auto _BuildCanal_dispatch = MakeDispatchTable(); bool BuildCanal::_post(::CommandCallback *callback) { return _BuildCanal_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->start_tile, this->wc, this->diagonal); } CommandCost BuildCanal::_do(DoCommandFlag flags) { - return (::Command::Do(flags, this->tile, start_tile, wc, diagonal)); + return (::Command::Do(flags, tile, start_tile, wc, diagonal)); } Commands BuildLock::get_command() { return CMD_BUILD_LOCK; } -static constexpr auto _BuildLock_dispatch = MakeDispatchTable(); +static constexpr auto _BuildLock_dispatch = MakeDispatchTable(); bool BuildLock::_post(::CommandCallback *callback) { return _BuildLock_dispatch[FindCallbackIndex(callback)](this->error, this->tile); } CommandCost BuildLock::_do(DoCommandFlag flags) { - return (::Command::Do(flags, this->tile)); + return (::Command::Do(flags, tile)); } Commands BuildLongRoad::get_command() { return CMD_BUILD_LONG_ROAD; } -static constexpr auto _BuildLongRoad_dispatch = MakeDispatchTable(); +static constexpr auto _BuildLongRoad_dispatch = MakeDispatchTable(); bool BuildLongRoad::_post(::CommandCallback *callback) { - return _BuildLongRoad_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->start_tile, this->rt, this->axis, this->drd, this->start_half, this->end_half, this->is_ai); + return _BuildLongRoad_dispatch[FindCallbackIndex(callback)](this->error, this->end_tile, this->start_tile, this->rt, this->axis, this->drd, this->start_half, this->end_half, this->is_ai); } CommandCost BuildLongRoad::_do(DoCommandFlag flags) { - return (::Command::Do(flags, this->tile, start_tile, rt, axis, drd, start_half, end_half, is_ai)); + return (::Command::Do(flags, end_tile, start_tile, rt, axis, drd, start_half, end_half, is_ai)); } Commands RemoveLongRoad::get_command() { return CMD_REMOVE_LONG_ROAD; } -static constexpr auto _RemoveLongRoad_dispatch = MakeDispatchTable(); +static constexpr auto _RemoveLongRoad_dispatch = MakeDispatchTable(); bool RemoveLongRoad::_post(::CommandCallback *callback) { - return _RemoveLongRoad_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->start_tile, this->rt, this->axis, this->start_half, this->end_half); + return _RemoveLongRoad_dispatch[FindCallbackIndex(callback)](this->error, this->end_tile, this->start_tile, this->rt, this->axis, this->start_half, this->end_half); } CommandCost RemoveLongRoad::_do(DoCommandFlag flags) { - return std::get<0>(::Command::Do(flags, this->tile, start_tile, rt, axis, start_half, end_half)); + return std::get<0>(::Command::Do(flags, end_tile, start_tile, rt, axis, start_half, end_half)); } Commands BuildRoad::get_command() { return CMD_BUILD_ROAD; } -static constexpr auto _BuildRoad_dispatch = MakeDispatchTable(); +static constexpr auto _BuildRoad_dispatch = MakeDispatchTable(); bool BuildRoad::_post(::CommandCallback *callback) { return _BuildRoad_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->pieces, this->rt, this->toggle_drd, this->town_id); } CommandCost BuildRoad::_do(DoCommandFlag flags) { - return (::Command::Do(flags, this->tile, pieces, rt, toggle_drd, town_id)); + return (::Command::Do(flags, tile, pieces, rt, toggle_drd, town_id)); } Commands BuildRoadDepot::get_command() { return CMD_BUILD_ROAD_DEPOT; } -static constexpr auto _BuildRoadDepot_dispatch = MakeDispatchTable(); +static constexpr auto _BuildRoadDepot_dispatch = MakeDispatchTable(); bool BuildRoadDepot::_post(::CommandCallback *callback) { return _BuildRoadDepot_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->rt, this->dir); } CommandCost BuildRoadDepot::_do(DoCommandFlag flags) { - return (::Command::Do(flags, this->tile, rt, dir)); + return (::Command::Do(flags, tile, rt, dir)); } Commands ConvertRoad::get_command() { return CMD_CONVERT_ROAD; } -static constexpr auto _ConvertRoad_dispatch = MakeDispatchTable(); +static constexpr auto _ConvertRoad_dispatch = MakeDispatchTable(); bool ConvertRoad::_post(::CommandCallback *callback) { return _ConvertRoad_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->area_start, this->to_type); } CommandCost ConvertRoad::_do(DoCommandFlag flags) { - return (::Command::Do(flags, this->tile, area_start, to_type)); + return (::Command::Do(flags, tile, area_start, to_type)); } Commands BuyShareInCompany::get_command() { return CMD_BUY_SHARE_IN_COMPANY; } static constexpr auto _BuyShareInCompany_dispatch = MakeDispatchTable(); bool BuyShareInCompany::_post(::CommandCallback *callback) { - return _BuyShareInCompany_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->target_company); + return _BuyShareInCompany_dispatch[FindCallbackIndex(callback)](this->error, this->target_company); } CommandCost BuyShareInCompany::_do(DoCommandFlag flags) { return (::Command::Do(flags, target_company)); @@ -486,7 +486,7 @@ CommandCost BuyShareInCompany::_do(DoCommandFlag flags) { Commands SellShareInCompany::get_command() { return CMD_SELL_SHARE_IN_COMPANY; } static constexpr auto _SellShareInCompany_dispatch = MakeDispatchTable(); bool SellShareInCompany::_post(::CommandCallback *callback) { - return _SellShareInCompany_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->target_company); + return _SellShareInCompany_dispatch[FindCallbackIndex(callback)](this->error, this->target_company); } CommandCost SellShareInCompany::_do(DoCommandFlag flags) { return (::Command::Do(flags, target_company)); @@ -495,52 +495,52 @@ CommandCost SellShareInCompany::_do(DoCommandFlag flags) { Commands BuyCompany::get_command() { return CMD_BUY_COMPANY; } static constexpr auto _BuyCompany_dispatch = MakeDispatchTable(); bool BuyCompany::_post(::CommandCallback *callback) { - return _BuyCompany_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->target_company); + return _BuyCompany_dispatch[FindCallbackIndex(callback)](this->error, this->target_company); } CommandCost BuyCompany::_do(DoCommandFlag flags) { return (::Command::Do(flags, target_company)); } Commands LandscapeClear::get_command() { return CMD_LANDSCAPE_CLEAR; } -static constexpr auto _LandscapeClear_dispatch = MakeDispatchTable(); +static constexpr auto _LandscapeClear_dispatch = MakeDispatchTable(); bool LandscapeClear::_post(::CommandCallback *callback) { return _LandscapeClear_dispatch[FindCallbackIndex(callback)](this->error, this->tile); } CommandCost LandscapeClear::_do(DoCommandFlag flags) { - return (::Command::Do(flags, this->tile)); + return (::Command::Do(flags, tile)); } Commands ClearArea::get_command() { return CMD_CLEAR_AREA; } -static constexpr auto _ClearArea_dispatch = MakeDispatchTable(); +static constexpr auto _ClearArea_dispatch = MakeDispatchTable(); bool ClearArea::_post(::CommandCallback *callback) { return _ClearArea_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->start_tile, this->diagonal); } CommandCost ClearArea::_do(DoCommandFlag flags) { - return std::get<0>(::Command::Do(flags, this->tile, start_tile, diagonal)); + return std::get<0>(::Command::Do(flags, tile, start_tile, diagonal)); } Commands MoveRailVehicle::get_command() { return CMD_MOVE_RAIL_VEHICLE; } -static constexpr auto _MoveRailVehicle_dispatch = MakeDispatchTable(); +static constexpr auto _MoveRailVehicle_dispatch = MakeDispatchTable(); bool MoveRailVehicle::_post(::CommandCallback *callback) { - return _MoveRailVehicle_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->src_veh, this->dest_veh, this->move_chain); + return _MoveRailVehicle_dispatch[FindCallbackIndex(callback)](this->error, this->location, this->src_veh, this->dest_veh, this->move_chain); } CommandCost MoveRailVehicle::_do(DoCommandFlag flags) { return (::Command::Do(flags, src_veh, dest_veh, move_chain)); } Commands ForceTrainProceed::get_command() { return CMD_FORCE_TRAIN_PROCEED; } -static constexpr auto _ForceTrainProceed_dispatch = MakeDispatchTable(); +static constexpr auto _ForceTrainProceed_dispatch = MakeDispatchTable(); bool ForceTrainProceed::_post(::CommandCallback *callback) { - return _ForceTrainProceed_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->veh_id); + return _ForceTrainProceed_dispatch[FindCallbackIndex(callback)](this->error, this->location, this->veh_id); } CommandCost ForceTrainProceed::_do(DoCommandFlag flags) { return (::Command::Do(flags, veh_id)); } Commands ReverseTrainDirection::get_command() { return CMD_REVERSE_TRAIN_DIRECTION; } -static constexpr auto _ReverseTrainDirection_dispatch = MakeDispatchTable(); +static constexpr auto _ReverseTrainDirection_dispatch = MakeDispatchTable(); bool ReverseTrainDirection::_post(::CommandCallback *callback) { - return _ReverseTrainDirection_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->veh_id, this->reverse_single_veh); + return _ReverseTrainDirection_dispatch[FindCallbackIndex(callback)](this->error, this->location, this->veh_id, this->reverse_single_veh); } CommandCost ReverseTrainDirection::_do(DoCommandFlag flags) { return (::Command::Do(flags, veh_id, reverse_single_veh)); @@ -549,25 +549,25 @@ CommandCost ReverseTrainDirection::_do(DoCommandFlag flags) { Commands CreateSubsidy::get_command() { return CMD_CREATE_SUBSIDY; } static constexpr auto _CreateSubsidy_dispatch = MakeDispatchTable(); bool CreateSubsidy::_post(::CommandCallback *callback) { - return _CreateSubsidy_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->cid, this->src_type, this->src, this->dst_type, this->dst); + return _CreateSubsidy_dispatch[FindCallbackIndex(callback)](this->error, this->cid, this->src_type, this->src, this->dst_type, this->dst); } CommandCost CreateSubsidy::_do(DoCommandFlag flags) { return (::Command::Do(flags, cid, src_type, src, dst_type, dst)); } Commands ScrollViewport::get_command() { return CMD_SCROLL_VIEWPORT; } -static constexpr auto _ScrollViewport_dispatch = MakeDispatchTable(); +static constexpr auto _ScrollViewport_dispatch = MakeDispatchTable(); bool ScrollViewport::_post(::CommandCallback *callback) { return _ScrollViewport_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->target, this->ref); } CommandCost ScrollViewport::_do(DoCommandFlag flags) { - return (::Command::Do(flags, this->tile, target, ref)); + return (::Command::Do(flags, tile, target, ref)); } Commands ChangeTimetable::get_command() { return CMD_CHANGE_TIMETABLE; } static constexpr auto _ChangeTimetable_dispatch = MakeDispatchTable(); bool ChangeTimetable::_post(::CommandCallback *callback) { - return _ChangeTimetable_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->veh, this->order_number, this->mtf, this->data); + return _ChangeTimetable_dispatch[FindCallbackIndex(callback)](this->error, this->veh, this->order_number, this->mtf, this->data); } CommandCost ChangeTimetable::_do(DoCommandFlag flags) { return (::Command::Do(flags, veh, order_number, mtf, data)); @@ -576,7 +576,7 @@ CommandCost ChangeTimetable::_do(DoCommandFlag flags) { Commands BulkChangeTimetable::get_command() { return CMD_BULK_CHANGE_TIMETABLE; } static constexpr auto _BulkChangeTimetable_dispatch = MakeDispatchTable(); bool BulkChangeTimetable::_post(::CommandCallback *callback) { - return _BulkChangeTimetable_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->veh, this->mtf, this->data); + return _BulkChangeTimetable_dispatch[FindCallbackIndex(callback)](this->error, this->veh, this->mtf, this->data); } CommandCost BulkChangeTimetable::_do(DoCommandFlag flags) { return (::Command::Do(flags, veh, mtf, data)); @@ -585,7 +585,7 @@ CommandCost BulkChangeTimetable::_do(DoCommandFlag flags) { Commands SetVehicleOnTime::get_command() { return CMD_SET_VEHICLE_ON_TIME; } static constexpr auto _SetVehicleOnTime_dispatch = MakeDispatchTable(); bool SetVehicleOnTime::_post(::CommandCallback *callback) { - return _SetVehicleOnTime_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->veh); + return _SetVehicleOnTime_dispatch[FindCallbackIndex(callback)](this->error, this->veh); } CommandCost SetVehicleOnTime::_do(DoCommandFlag flags) { return (::Command::Do(flags, veh)); @@ -594,7 +594,7 @@ CommandCost SetVehicleOnTime::_do(DoCommandFlag flags) { Commands AutofillTimetable::get_command() { return CMD_AUTOFILL_TIMETABLE; } static constexpr auto _AutofillTimetable_dispatch = MakeDispatchTable(); bool AutofillTimetable::_post(::CommandCallback *callback) { - return _AutofillTimetable_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->veh, this->autofill, this->preserve_wait_time); + return _AutofillTimetable_dispatch[FindCallbackIndex(callback)](this->error, this->veh, this->autofill, this->preserve_wait_time); } CommandCost AutofillTimetable::_do(DoCommandFlag flags) { return (::Command::Do(flags, veh, autofill, preserve_wait_time)); @@ -603,25 +603,25 @@ CommandCost AutofillTimetable::_do(DoCommandFlag flags) { Commands SetTimetableStart::get_command() { return CMD_SET_TIMETABLE_START; } static constexpr auto _SetTimetableStart_dispatch = MakeDispatchTable(); bool SetTimetableStart::_post(::CommandCallback *callback) { - return _SetTimetableStart_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->veh_id, this->timetable_all, this->start_date); + return _SetTimetableStart_dispatch[FindCallbackIndex(callback)](this->error, this->veh_id, this->timetable_all, this->start_date); } CommandCost SetTimetableStart::_do(DoCommandFlag flags) { return (::Command::Do(flags, veh_id, timetable_all, start_date)); } Commands PlantTree::get_command() { return CMD_PLANT_TREE; } -static constexpr auto _PlantTree_dispatch = MakeDispatchTable(); +static constexpr auto _PlantTree_dispatch = MakeDispatchTable(); bool PlantTree::_post(::CommandCallback *callback) { return _PlantTree_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->start_tile, this->tree_to_plant, this->diagonal); } CommandCost PlantTree::_do(DoCommandFlag flags) { - return (::Command::Do(flags, this->tile, start_tile, tree_to_plant, diagonal)); + return (::Command::Do(flags, tile, start_tile, tree_to_plant, diagonal)); } Commands CreateLeagueTable::get_command() { return CMD_CREATE_LEAGUE_TABLE; } static constexpr auto _CreateLeagueTable_dispatch = MakeDispatchTable(); bool CreateLeagueTable::_post(::CommandCallback *callback) { - return _CreateLeagueTable_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->title, this->header, this->footer); + return _CreateLeagueTable_dispatch[FindCallbackIndex(callback)](this->error, this->title, this->header, this->footer); } CommandCost CreateLeagueTable::_do(DoCommandFlag flags) { return std::get<0>(::Command::Do(flags, title, header, footer)); @@ -630,7 +630,7 @@ CommandCost CreateLeagueTable::_do(DoCommandFlag flags) { Commands CreateLeagueTableElement::get_command() { return CMD_CREATE_LEAGUE_TABLE_ELEMENT; } static constexpr auto _CreateLeagueTableElement_dispatch = MakeDispatchTable(); bool CreateLeagueTableElement::_post(::CommandCallback *callback) { - return _CreateLeagueTableElement_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->table, this->rating, this->company, this->text, this->score, this->link_type, this->link_target); + return _CreateLeagueTableElement_dispatch[FindCallbackIndex(callback)](this->error, this->table, this->rating, this->company, this->text, this->score, this->link_type, this->link_target); } CommandCost CreateLeagueTableElement::_do(DoCommandFlag flags) { return std::get<0>(::Command::Do(flags, table, rating, company, text, score, link_type, link_target)); @@ -639,7 +639,7 @@ CommandCost CreateLeagueTableElement::_do(DoCommandFlag flags) { Commands UpdateLeagueTableElementData::get_command() { return CMD_UPDATE_LEAGUE_TABLE_ELEMENT_DATA; } static constexpr auto _UpdateLeagueTableElementData_dispatch = MakeDispatchTable(); bool UpdateLeagueTableElementData::_post(::CommandCallback *callback) { - return _UpdateLeagueTableElementData_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->element, this->company, this->text, this->link_type, this->link_target); + return _UpdateLeagueTableElementData_dispatch[FindCallbackIndex(callback)](this->error, this->element, this->company, this->text, this->link_type, this->link_target); } CommandCost UpdateLeagueTableElementData::_do(DoCommandFlag flags) { return (::Command::Do(flags, element, company, text, link_type, link_target)); @@ -648,7 +648,7 @@ CommandCost UpdateLeagueTableElementData::_do(DoCommandFlag flags) { Commands UpdateLeagueTableElementScore::get_command() { return CMD_UPDATE_LEAGUE_TABLE_ELEMENT_SCORE; } static constexpr auto _UpdateLeagueTableElementScore_dispatch = MakeDispatchTable(); bool UpdateLeagueTableElementScore::_post(::CommandCallback *callback) { - return _UpdateLeagueTableElementScore_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->element, this->rating, this->score); + return _UpdateLeagueTableElementScore_dispatch[FindCallbackIndex(callback)](this->error, this->element, this->rating, this->score); } CommandCost UpdateLeagueTableElementScore::_do(DoCommandFlag flags) { return (::Command::Do(flags, element, rating, score)); @@ -657,52 +657,52 @@ CommandCost UpdateLeagueTableElementScore::_do(DoCommandFlag flags) { Commands RemoveLeagueTableElement::get_command() { return CMD_REMOVE_LEAGUE_TABLE_ELEMENT; } static constexpr auto _RemoveLeagueTableElement_dispatch = MakeDispatchTable(); bool RemoveLeagueTableElement::_post(::CommandCallback *callback) { - return _RemoveLeagueTableElement_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->element); + return _RemoveLeagueTableElement_dispatch[FindCallbackIndex(callback)](this->error, this->element); } CommandCost RemoveLeagueTableElement::_do(DoCommandFlag flags) { return (::Command::Do(flags, element)); } Commands PlaceSign::get_command() { return CMD_PLACE_SIGN; } -static constexpr auto _PlaceSign_dispatch = MakeDispatchTable(); +static constexpr auto _PlaceSign_dispatch = MakeDispatchTable(); bool PlaceSign::_post(::CommandCallback *callback) { return _PlaceSign_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->text); } CommandCost PlaceSign::_do(DoCommandFlag flags) { - return std::get<0>(::Command::Do(flags, this->tile, text)); + return std::get<0>(::Command::Do(flags, tile, text)); } Commands RenameSign::get_command() { return CMD_RENAME_SIGN; } static constexpr auto _RenameSign_dispatch = MakeDispatchTable(); bool RenameSign::_post(::CommandCallback *callback) { - return _RenameSign_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->sign_id, this->text); + return _RenameSign_dispatch[FindCallbackIndex(callback)](this->error, this->sign_id, this->text); } CommandCost RenameSign::_do(DoCommandFlag flags) { return (::Command::Do(flags, sign_id, text)); } Commands BuildVehicle::get_command() { return CMD_BUILD_VEHICLE; } -static constexpr auto _BuildVehicle_dispatch = MakeDispatchTable(); +static constexpr auto _BuildVehicle_dispatch = MakeDispatchTable(); bool BuildVehicle::_post(::CommandCallback *callback) { return _BuildVehicle_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->eid, this->use_free_vehicles, this->cargo, this->client_id); } CommandCost BuildVehicle::_do(DoCommandFlag flags) { - return std::get<0>(::Command::Do(flags, this->tile, eid, use_free_vehicles, cargo, client_id)); + return std::get<0>(::Command::Do(flags, tile, eid, use_free_vehicles, cargo, client_id)); } Commands SellVehicle::get_command() { return CMD_SELL_VEHICLE; } -static constexpr auto _SellVehicle_dispatch = MakeDispatchTable(); +static constexpr auto _SellVehicle_dispatch = MakeDispatchTable(); bool SellVehicle::_post(::CommandCallback *callback) { - return _SellVehicle_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->v_id, this->sell_chain, this->backup_order, this->client_id); + return _SellVehicle_dispatch[FindCallbackIndex(callback)](this->error, this->location, this->v_id, this->sell_chain, this->backup_order, this->client_id); } CommandCost SellVehicle::_do(DoCommandFlag flags) { return (::Command::Do(flags, v_id, sell_chain, backup_order, client_id)); } Commands RefitVehicle::get_command() { return CMD_REFIT_VEHICLE; } -static constexpr auto _RefitVehicle_dispatch = MakeDispatchTable(); +static constexpr auto _RefitVehicle_dispatch = MakeDispatchTable(); bool RefitVehicle::_post(::CommandCallback *callback) { - return _RefitVehicle_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->veh_id, this->new_cid, this->new_subtype, this->auto_refit, this->only_this, this->num_vehicles); + return _RefitVehicle_dispatch[FindCallbackIndex(callback)](this->error, this->location, this->veh_id, this->new_cid, this->new_subtype, this->auto_refit, this->only_this, this->num_vehicles); } CommandCost RefitVehicle::_do(DoCommandFlag flags) { return std::get<0>(::Command::Do(flags, veh_id, new_cid, new_subtype, auto_refit, only_this, num_vehicles)); @@ -711,7 +711,7 @@ CommandCost RefitVehicle::_do(DoCommandFlag flags) { Commands SendVehicleToDepot::get_command() { return CMD_SEND_VEHICLE_TO_DEPOT; } static constexpr auto _SendVehicleToDepot_dispatch = MakeDispatchTable(); bool SendVehicleToDepot::_post(::CommandCallback *callback) { - return _SendVehicleToDepot_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->veh_id, this->depot_cmd, this->vli); + return _SendVehicleToDepot_dispatch[FindCallbackIndex(callback)](this->error, this->veh_id, this->depot_cmd, this->vli); } CommandCost SendVehicleToDepot::_do(DoCommandFlag flags) { return (::Command::Do(flags, veh_id, depot_cmd, vli)); @@ -720,7 +720,7 @@ CommandCost SendVehicleToDepot::_do(DoCommandFlag flags) { Commands ChangeServiceInt::get_command() { return CMD_CHANGE_SERVICE_INT; } static constexpr auto _ChangeServiceInt_dispatch = MakeDispatchTable(); bool ChangeServiceInt::_post(::CommandCallback *callback) { - return _ChangeServiceInt_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->veh_id, this->serv_int, this->is_custom, this->is_percent); + return _ChangeServiceInt_dispatch[FindCallbackIndex(callback)](this->error, this->veh_id, this->serv_int, this->is_custom, this->is_percent); } CommandCost ChangeServiceInt::_do(DoCommandFlag flags) { return (::Command::Do(flags, veh_id, serv_int, is_custom, is_percent)); @@ -729,178 +729,178 @@ CommandCost ChangeServiceInt::_do(DoCommandFlag flags) { Commands RenameVehicle::get_command() { return CMD_RENAME_VEHICLE; } static constexpr auto _RenameVehicle_dispatch = MakeDispatchTable(); bool RenameVehicle::_post(::CommandCallback *callback) { - return _RenameVehicle_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->veh_id, this->text); + return _RenameVehicle_dispatch[FindCallbackIndex(callback)](this->error, this->veh_id, this->text); } CommandCost RenameVehicle::_do(DoCommandFlag flags) { return (::Command::Do(flags, veh_id, text)); } Commands CloneVehicle::get_command() { return CMD_CLONE_VEHICLE; } -static constexpr auto _CloneVehicle_dispatch = MakeDispatchTable(); +static constexpr auto _CloneVehicle_dispatch = MakeDispatchTable(); bool CloneVehicle::_post(::CommandCallback *callback) { return _CloneVehicle_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->veh_id, this->share_orders); } CommandCost CloneVehicle::_do(DoCommandFlag flags) { - return std::get<0>(::Command::Do(flags, this->tile, veh_id, share_orders)); + return std::get<0>(::Command::Do(flags, tile, veh_id, share_orders)); } Commands StartStopVehicle::get_command() { return CMD_START_STOP_VEHICLE; } -static constexpr auto _StartStopVehicle_dispatch = MakeDispatchTable(); +static constexpr auto _StartStopVehicle_dispatch = MakeDispatchTable(); bool StartStopVehicle::_post(::CommandCallback *callback) { - return _StartStopVehicle_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->veh_id, this->evaluate_startstop_cb); + return _StartStopVehicle_dispatch[FindCallbackIndex(callback)](this->error, this->location, this->veh_id, this->evaluate_startstop_cb); } CommandCost StartStopVehicle::_do(DoCommandFlag flags) { return (::Command::Do(flags, veh_id, evaluate_startstop_cb)); } Commands MassStartStopVehicle::get_command() { return CMD_MASS_START_STOP; } -static constexpr auto _MassStartStopVehicle_dispatch = MakeDispatchTable(); +static constexpr auto _MassStartStopVehicle_dispatch = MakeDispatchTable(); bool MassStartStopVehicle::_post(::CommandCallback *callback) { return _MassStartStopVehicle_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->do_start, this->vehicle_list_window, this->vli); } CommandCost MassStartStopVehicle::_do(DoCommandFlag flags) { - return (::Command::Do(flags, this->tile, do_start, vehicle_list_window, vli)); + return (::Command::Do(flags, tile, do_start, vehicle_list_window, vli)); } Commands DepotSellAllVehicles::get_command() { return CMD_DEPOT_SELL_ALL_VEHICLES; } -static constexpr auto _DepotSellAllVehicles_dispatch = MakeDispatchTable(); +static constexpr auto _DepotSellAllVehicles_dispatch = MakeDispatchTable(); bool DepotSellAllVehicles::_post(::CommandCallback *callback) { return _DepotSellAllVehicles_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->vehicle_type); } CommandCost DepotSellAllVehicles::_do(DoCommandFlag flags) { - return (::Command::Do(flags, this->tile, vehicle_type)); + return (::Command::Do(flags, tile, vehicle_type)); } Commands DepotMassAutoReplace::get_command() { return CMD_DEPOT_MASS_AUTOREPLACE; } -static constexpr auto _DepotMassAutoReplace_dispatch = MakeDispatchTable(); +static constexpr auto _DepotMassAutoReplace_dispatch = MakeDispatchTable(); bool DepotMassAutoReplace::_post(::CommandCallback *callback) { return _DepotMassAutoReplace_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->vehicle_type); } CommandCost DepotMassAutoReplace::_do(DoCommandFlag flags) { - return (::Command::Do(flags, this->tile, vehicle_type)); + return (::Command::Do(flags, tile, vehicle_type)); } Commands TerraformLand::get_command() { return CMD_TERRAFORM_LAND; } -static constexpr auto _TerraformLand_dispatch = MakeDispatchTable(); +static constexpr auto _TerraformLand_dispatch = MakeDispatchTable(); bool TerraformLand::_post(::CommandCallback *callback) { return _TerraformLand_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->slope, this->dir_up); } CommandCost TerraformLand::_do(DoCommandFlag flags) { - return std::get<0>(::Command::Do(flags, this->tile, slope, dir_up)); + return std::get<0>(::Command::Do(flags, tile, slope, dir_up)); } Commands LevelLand::get_command() { return CMD_LEVEL_LAND; } -static constexpr auto _LevelLand_dispatch = MakeDispatchTable(); +static constexpr auto _LevelLand_dispatch = MakeDispatchTable(); bool LevelLand::_post(::CommandCallback *callback) { return _LevelLand_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->start_tile, this->diagonal, this->lm); } CommandCost LevelLand::_do(DoCommandFlag flags) { - return std::get<0>(::Command::Do(flags, this->tile, start_tile, diagonal, lm)); + return std::get<0>(::Command::Do(flags, tile, start_tile, diagonal, lm)); } Commands RenameDepot::get_command() { return CMD_RENAME_DEPOT; } static constexpr auto _RenameDepot_dispatch = MakeDispatchTable(); bool RenameDepot::_post(::CommandCallback *callback) { - return _RenameDepot_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->depot_id, this->text); + return _RenameDepot_dispatch[FindCallbackIndex(callback)](this->error, this->depot_id, this->text); } CommandCost RenameDepot::_do(DoCommandFlag flags) { return (::Command::Do(flags, depot_id, text)); } Commands BuildRailroadTrack::get_command() { return CMD_BUILD_RAILROAD_TRACK; } -static constexpr auto _BuildRailroadTrack_dispatch = MakeDispatchTable(); +static constexpr auto _BuildRailroadTrack_dispatch = MakeDispatchTable(); bool BuildRailroadTrack::_post(::CommandCallback *callback) { - return _BuildRailroadTrack_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->start_tile, this->railtype, this->track, this->auto_remove_signals, this->fail_on_obstacle); + return _BuildRailroadTrack_dispatch[FindCallbackIndex(callback)](this->error, this->end_tile, this->start_tile, this->railtype, this->track, this->auto_remove_signals, this->fail_on_obstacle); } CommandCost BuildRailroadTrack::_do(DoCommandFlag flags) { - return (::Command::Do(flags, this->tile, start_tile, railtype, track, auto_remove_signals, fail_on_obstacle)); + return (::Command::Do(flags, end_tile, start_tile, railtype, track, auto_remove_signals, fail_on_obstacle)); } Commands RemoveRailroadTrack::get_command() { return CMD_REMOVE_RAILROAD_TRACK; } -static constexpr auto _RemoveRailroadTrack_dispatch = MakeDispatchTable(); +static constexpr auto _RemoveRailroadTrack_dispatch = MakeDispatchTable(); bool RemoveRailroadTrack::_post(::CommandCallback *callback) { - return _RemoveRailroadTrack_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->start_tile, this->track); + return _RemoveRailroadTrack_dispatch[FindCallbackIndex(callback)](this->error, this->end_tile, this->start_tile, this->track); } CommandCost RemoveRailroadTrack::_do(DoCommandFlag flags) { - return (::Command::Do(flags, this->tile, start_tile, track)); + return (::Command::Do(flags, end_tile, start_tile, track)); } Commands BuildSingleRail::get_command() { return CMD_BUILD_SINGLE_RAIL; } -static constexpr auto _BuildSingleRail_dispatch = MakeDispatchTable(); +static constexpr auto _BuildSingleRail_dispatch = MakeDispatchTable(); bool BuildSingleRail::_post(::CommandCallback *callback) { return _BuildSingleRail_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->railtype, this->track, this->auto_remove_signals); } CommandCost BuildSingleRail::_do(DoCommandFlag flags) { - return (::Command::Do(flags, this->tile, railtype, track, auto_remove_signals)); + return (::Command::Do(flags, tile, railtype, track, auto_remove_signals)); } Commands RemoveSingleRail::get_command() { return CMD_REMOVE_SINGLE_RAIL; } -static constexpr auto _RemoveSingleRail_dispatch = MakeDispatchTable(); +static constexpr auto _RemoveSingleRail_dispatch = MakeDispatchTable(); bool RemoveSingleRail::_post(::CommandCallback *callback) { return _RemoveSingleRail_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->track); } CommandCost RemoveSingleRail::_do(DoCommandFlag flags) { - return (::Command::Do(flags, this->tile, track)); + return (::Command::Do(flags, tile, track)); } Commands BuildTrainDepot::get_command() { return CMD_BUILD_TRAIN_DEPOT; } -static constexpr auto _BuildTrainDepot_dispatch = MakeDispatchTable(); +static constexpr auto _BuildTrainDepot_dispatch = MakeDispatchTable(); bool BuildTrainDepot::_post(::CommandCallback *callback) { return _BuildTrainDepot_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->railtype, this->dir); } CommandCost BuildTrainDepot::_do(DoCommandFlag flags) { - return (::Command::Do(flags, this->tile, railtype, dir)); + return (::Command::Do(flags, tile, railtype, dir)); } Commands BuildSingleSignal::get_command() { return CMD_BUILD_SIGNALS; } -static constexpr auto _BuildSingleSignal_dispatch = MakeDispatchTable(); +static constexpr auto _BuildSingleSignal_dispatch = MakeDispatchTable(); bool BuildSingleSignal::_post(::CommandCallback *callback) { return _BuildSingleSignal_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->track, this->sigtype, this->sigvar, this->convert_signal, this->skip_existing_signals, this->ctrl_pressed, this->cycle_start, this->cycle_stop, this->num_dir_cycle, this->signals_copy); } CommandCost BuildSingleSignal::_do(DoCommandFlag flags) { - return (::Command::Do(flags, this->tile, track, sigtype, sigvar, convert_signal, skip_existing_signals, ctrl_pressed, cycle_start, cycle_stop, num_dir_cycle, signals_copy)); + return (::Command::Do(flags, tile, track, sigtype, sigvar, convert_signal, skip_existing_signals, ctrl_pressed, cycle_start, cycle_stop, num_dir_cycle, signals_copy)); } Commands RemoveSingleSignal::get_command() { return CMD_REMOVE_SIGNALS; } -static constexpr auto _RemoveSingleSignal_dispatch = MakeDispatchTable(); +static constexpr auto _RemoveSingleSignal_dispatch = MakeDispatchTable(); bool RemoveSingleSignal::_post(::CommandCallback *callback) { return _RemoveSingleSignal_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->track); } CommandCost RemoveSingleSignal::_do(DoCommandFlag flags) { - return (::Command::Do(flags, this->tile, track)); + return (::Command::Do(flags, tile, track)); } Commands ConvertRail::get_command() { return CMD_CONVERT_RAIL; } -static constexpr auto _ConvertRail_dispatch = MakeDispatchTable(); +static constexpr auto _ConvertRail_dispatch = MakeDispatchTable(); bool ConvertRail::_post(::CommandCallback *callback) { return _ConvertRail_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->area_start, this->totype, this->diagonal); } CommandCost ConvertRail::_do(DoCommandFlag flags) { - return (::Command::Do(flags, this->tile, area_start, totype, diagonal)); + return (::Command::Do(flags, tile, area_start, totype, diagonal)); } Commands BuildSignalTrack::get_command() { return CMD_BUILD_SIGNAL_TRACK; } -static constexpr auto _BuildSignalTrack_dispatch = MakeDispatchTable(); +static constexpr auto _BuildSignalTrack_dispatch = MakeDispatchTable(); bool BuildSignalTrack::_post(::CommandCallback *callback) { return _BuildSignalTrack_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->end_tile, this->track, this->sigtype, this->sigvar, this->mode, this->autofill, this->minimise_gaps, this->signal_density); } CommandCost BuildSignalTrack::_do(DoCommandFlag flags) { - return (::Command::Do(flags, this->tile, end_tile, track, sigtype, sigvar, mode, autofill, minimise_gaps, signal_density)); + return (::Command::Do(flags, tile, end_tile, track, sigtype, sigvar, mode, autofill, minimise_gaps, signal_density)); } Commands RemoveSignalTrack::get_command() { return CMD_REMOVE_SIGNAL_TRACK; } -static constexpr auto _RemoveSignalTrack_dispatch = MakeDispatchTable(); +static constexpr auto _RemoveSignalTrack_dispatch = MakeDispatchTable(); bool RemoveSignalTrack::_post(::CommandCallback *callback) { return _RemoveSignalTrack_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->end_tile, this->track, this->autofill); } CommandCost RemoveSignalTrack::_do(DoCommandFlag flags) { - return (::Command::Do(flags, this->tile, end_tile, track, autofill)); + return (::Command::Do(flags, tile, end_tile, track, autofill)); } Commands CompanyCtrl::get_command() { return CMD_COMPANY_CTRL; } static constexpr auto _CompanyCtrl_dispatch = MakeDispatchTable(); bool CompanyCtrl::_post(::CommandCallback *callback) { - return _CompanyCtrl_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->cca, this->company_id, this->reason, this->client_id); + return _CompanyCtrl_dispatch[FindCallbackIndex(callback)](this->error, this->cca, this->company_id, this->reason, this->client_id); } CommandCost CompanyCtrl::_do(DoCommandFlag flags) { return (::Command::Do(flags, cca, company_id, reason, client_id)); @@ -909,7 +909,7 @@ CommandCost CompanyCtrl::_do(DoCommandFlag flags) { Commands GiveMoney::get_command() { return CMD_GIVE_MONEY; } static constexpr auto _GiveMoney_dispatch = MakeDispatchTable(); bool GiveMoney::_post(::CommandCallback *callback) { - return _GiveMoney_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->money, this->dest_company); + return _GiveMoney_dispatch[FindCallbackIndex(callback)](this->error, this->money, this->dest_company); } CommandCost GiveMoney::_do(DoCommandFlag flags) { return (::Command::Do(flags, money, dest_company)); @@ -918,7 +918,7 @@ CommandCost GiveMoney::_do(DoCommandFlag flags) { Commands RenameCompany::get_command() { return CMD_RENAME_COMPANY; } static constexpr auto _RenameCompany_dispatch = MakeDispatchTable(); bool RenameCompany::_post(::CommandCallback *callback) { - return _RenameCompany_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->text); + return _RenameCompany_dispatch[FindCallbackIndex(callback)](this->error, this->text); } CommandCost RenameCompany::_do(DoCommandFlag flags) { return (::Command::Do(flags, text)); @@ -927,7 +927,7 @@ CommandCost RenameCompany::_do(DoCommandFlag flags) { Commands RenamePresident::get_command() { return CMD_RENAME_PRESIDENT; } static constexpr auto _RenamePresident_dispatch = MakeDispatchTable(); bool RenamePresident::_post(::CommandCallback *callback) { - return _RenamePresident_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->text); + return _RenamePresident_dispatch[FindCallbackIndex(callback)](this->error, this->text); } CommandCost RenamePresident::_do(DoCommandFlag flags) { return (::Command::Do(flags, text)); @@ -936,7 +936,7 @@ CommandCost RenamePresident::_do(DoCommandFlag flags) { Commands SetCompanyManagerFace::get_command() { return CMD_SET_COMPANY_MANAGER_FACE; } static constexpr auto _SetCompanyManagerFace_dispatch = MakeDispatchTable(); bool SetCompanyManagerFace::_post(::CommandCallback *callback) { - return _SetCompanyManagerFace_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->cmf); + return _SetCompanyManagerFace_dispatch[FindCallbackIndex(callback)](this->error, this->cmf); } CommandCost SetCompanyManagerFace::_do(DoCommandFlag flags) { return (::Command::Do(flags, cmf)); @@ -945,7 +945,7 @@ CommandCost SetCompanyManagerFace::_do(DoCommandFlag flags) { Commands SetCompanyColour::get_command() { return CMD_SET_COMPANY_COLOUR; } static constexpr auto _SetCompanyColour_dispatch = MakeDispatchTable(); bool SetCompanyColour::_post(::CommandCallback *callback) { - return _SetCompanyColour_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->scheme, this->primary, this->colour); + return _SetCompanyColour_dispatch[FindCallbackIndex(callback)](this->error, this->scheme, this->primary, this->colour); } CommandCost SetCompanyColour::_do(DoCommandFlag flags) { return (::Command::Do(flags, scheme, primary, colour)); @@ -954,7 +954,7 @@ CommandCost SetCompanyColour::_do(DoCommandFlag flags) { Commands AutoreplaceVehicle::get_command() { return CMD_AUTOREPLACE_VEHICLE; } static constexpr auto _AutoreplaceVehicle_dispatch = MakeDispatchTable(); bool AutoreplaceVehicle::_post(::CommandCallback *callback) { - return _AutoreplaceVehicle_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->veh_id); + return _AutoreplaceVehicle_dispatch[FindCallbackIndex(callback)](this->error, this->veh_id); } CommandCost AutoreplaceVehicle::_do(DoCommandFlag flags) { return (::Command::Do(flags, veh_id)); @@ -963,34 +963,34 @@ CommandCost AutoreplaceVehicle::_do(DoCommandFlag flags) { Commands SetAutoReplace::get_command() { return CMD_SET_AUTOREPLACE; } static constexpr auto _SetAutoReplace_dispatch = MakeDispatchTable(); bool SetAutoReplace::_post(::CommandCallback *callback) { - return _SetAutoReplace_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->id_g, this->old_engine_type, this->new_engine_type, this->when_old); + return _SetAutoReplace_dispatch[FindCallbackIndex(callback)](this->error, this->id_g, this->old_engine_type, this->new_engine_type, this->when_old); } CommandCost SetAutoReplace::_do(DoCommandFlag flags) { return (::Command::Do(flags, id_g, old_engine_type, new_engine_type, when_old)); } Commands FoundTown::get_command() { return CMD_FOUND_TOWN; } -static constexpr auto _FoundTown_dispatch = MakeDispatchTable(); +static constexpr auto _FoundTown_dispatch = MakeDispatchTable(); bool FoundTown::_post(::CommandCallback *callback) { return _FoundTown_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->size, this->city, this->layout, this->random_location, this->townnameparts, this->text); } CommandCost FoundTown::_do(DoCommandFlag flags) { - return std::get<0>(::Command::Do(flags, this->tile, size, city, layout, random_location, townnameparts, text)); + return std::get<0>(::Command::Do(flags, tile, size, city, layout, random_location, townnameparts, text)); } Commands RenameTown::get_command() { return CMD_RENAME_TOWN; } static constexpr auto _RenameTown_dispatch = MakeDispatchTable(); bool RenameTown::_post(::CommandCallback *callback) { - return _RenameTown_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->town_id, this->text); + return _RenameTown_dispatch[FindCallbackIndex(callback)](this->error, this->town_id, this->text); } CommandCost RenameTown::_do(DoCommandFlag flags) { return (::Command::Do(flags, town_id, text)); } Commands DoTownAction::get_command() { return CMD_DO_TOWN_ACTION; } -static constexpr auto _DoTownAction_dispatch = MakeDispatchTable(); +static constexpr auto _DoTownAction_dispatch = MakeDispatchTable(); bool DoTownAction::_post(::CommandCallback *callback) { - return _DoTownAction_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->town_id, this->action); + return _DoTownAction_dispatch[FindCallbackIndex(callback)](this->error, this->location, this->town_id, this->action); } CommandCost DoTownAction::_do(DoCommandFlag flags) { return (::Command::Do(flags, town_id, action)); @@ -999,7 +999,7 @@ CommandCost DoTownAction::_do(DoCommandFlag flags) { Commands TownGrowthRate::get_command() { return CMD_TOWN_GROWTH_RATE; } static constexpr auto _TownGrowthRate_dispatch = MakeDispatchTable(); bool TownGrowthRate::_post(::CommandCallback *callback) { - return _TownGrowthRate_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->town_id, this->growth_rate); + return _TownGrowthRate_dispatch[FindCallbackIndex(callback)](this->error, this->town_id, this->growth_rate); } CommandCost TownGrowthRate::_do(DoCommandFlag flags) { return (::Command::Do(flags, town_id, growth_rate)); @@ -1008,7 +1008,7 @@ CommandCost TownGrowthRate::_do(DoCommandFlag flags) { Commands TownRating::get_command() { return CMD_TOWN_RATING; } static constexpr auto _TownRating_dispatch = MakeDispatchTable(); bool TownRating::_post(::CommandCallback *callback) { - return _TownRating_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->town_id, this->company_id, this->rating); + return _TownRating_dispatch[FindCallbackIndex(callback)](this->error, this->town_id, this->company_id, this->rating); } CommandCost TownRating::_do(DoCommandFlag flags) { return (::Command::Do(flags, town_id, company_id, rating)); @@ -1017,7 +1017,7 @@ CommandCost TownRating::_do(DoCommandFlag flags) { Commands TownCargoGoal::get_command() { return CMD_TOWN_CARGO_GOAL; } static constexpr auto _TownCargoGoal_dispatch = MakeDispatchTable(); bool TownCargoGoal::_post(::CommandCallback *callback) { - return _TownCargoGoal_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->town_id, this->te, this->goal); + return _TownCargoGoal_dispatch[FindCallbackIndex(callback)](this->error, this->town_id, this->te, this->goal); } CommandCost TownCargoGoal::_do(DoCommandFlag flags) { return (::Command::Do(flags, town_id, te, goal)); @@ -1026,7 +1026,7 @@ CommandCost TownCargoGoal::_do(DoCommandFlag flags) { Commands TownSetText::get_command() { return CMD_TOWN_SET_TEXT; } static constexpr auto _TownSetText_dispatch = MakeDispatchTable(); bool TownSetText::_post(::CommandCallback *callback) { - return _TownSetText_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->town_id, this->text); + return _TownSetText_dispatch[FindCallbackIndex(callback)](this->error, this->town_id, this->text); } CommandCost TownSetText::_do(DoCommandFlag flags) { return (::Command::Do(flags, town_id, text)); @@ -1035,7 +1035,7 @@ CommandCost TownSetText::_do(DoCommandFlag flags) { Commands ExpandTown::get_command() { return CMD_EXPAND_TOWN; } static constexpr auto _ExpandTown_dispatch = MakeDispatchTable(); bool ExpandTown::_post(::CommandCallback *callback) { - return _ExpandTown_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->town_id, this->grow_amount); + return _ExpandTown_dispatch[FindCallbackIndex(callback)](this->error, this->town_id, this->grow_amount); } CommandCost ExpandTown::_do(DoCommandFlag flags) { return (::Command::Do(flags, town_id, grow_amount)); @@ -1044,133 +1044,133 @@ CommandCost ExpandTown::_do(DoCommandFlag flags) { Commands DeleteTown::get_command() { return CMD_DELETE_TOWN; } static constexpr auto _DeleteTown_dispatch = MakeDispatchTable(); bool DeleteTown::_post(::CommandCallback *callback) { - return _DeleteTown_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->town_id); + return _DeleteTown_dispatch[FindCallbackIndex(callback)](this->error, this->town_id); } CommandCost DeleteTown::_do(DoCommandFlag flags) { return (::Command::Do(flags, town_id)); } Commands TurnRoadVeh::get_command() { return CMD_TURN_ROADVEH; } -static constexpr auto _TurnRoadVeh_dispatch = MakeDispatchTable(); +static constexpr auto _TurnRoadVeh_dispatch = MakeDispatchTable(); bool TurnRoadVeh::_post(::CommandCallback *callback) { - return _TurnRoadVeh_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->veh_id); + return _TurnRoadVeh_dispatch[FindCallbackIndex(callback)](this->error, this->location, this->veh_id); } CommandCost TurnRoadVeh::_do(DoCommandFlag flags) { return (::Command::Do(flags, veh_id)); } Commands BuildIndustry::get_command() { return CMD_BUILD_INDUSTRY; } -static constexpr auto _BuildIndustry_dispatch = MakeDispatchTable(); +static constexpr auto _BuildIndustry_dispatch = MakeDispatchTable(); bool BuildIndustry::_post(::CommandCallback *callback) { return _BuildIndustry_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->it, this->first_layout, this->fund, this->seed); } CommandCost BuildIndustry::_do(DoCommandFlag flags) { - return (::Command::Do(flags, this->tile, it, first_layout, fund, seed)); + return (::Command::Do(flags, tile, it, first_layout, fund, seed)); } Commands IndustryCtrl::get_command() { return CMD_INDUSTRY_CTRL; } static constexpr auto _IndustryCtrl_dispatch = MakeDispatchTable(); bool IndustryCtrl::_post(::CommandCallback *callback) { - return _IndustryCtrl_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->ind_id, this->action, this->ctlflags, this->company_id, this->text); + return _IndustryCtrl_dispatch[FindCallbackIndex(callback)](this->error, this->ind_id, this->action, this->ctlflags, this->company_id, this->text); } CommandCost IndustryCtrl::_do(DoCommandFlag flags) { return (::Command::Do(flags, ind_id, action, ctlflags, company_id, text)); } Commands ModifyOrder::get_command() { return CMD_MODIFY_ORDER; } -static constexpr auto _ModifyOrder_dispatch = MakeDispatchTable(); +static constexpr auto _ModifyOrder_dispatch = MakeDispatchTable(); bool ModifyOrder::_post(::CommandCallback *callback) { - return _ModifyOrder_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->veh, this->sel_ord, this->mof, this->data); + return _ModifyOrder_dispatch[FindCallbackIndex(callback)](this->error, this->location, this->veh, this->sel_ord, this->mof, this->data); } CommandCost ModifyOrder::_do(DoCommandFlag flags) { return (::Command::Do(flags, veh, sel_ord, mof, data)); } Commands SkipToOrder::get_command() { return CMD_SKIP_TO_ORDER; } -static constexpr auto _SkipToOrder_dispatch = MakeDispatchTable(); +static constexpr auto _SkipToOrder_dispatch = MakeDispatchTable(); bool SkipToOrder::_post(::CommandCallback *callback) { - return _SkipToOrder_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->veh_id, this->sel_ord); + return _SkipToOrder_dispatch[FindCallbackIndex(callback)](this->error, this->location, this->veh_id, this->sel_ord); } CommandCost SkipToOrder::_do(DoCommandFlag flags) { return (::Command::Do(flags, veh_id, sel_ord)); } Commands DeleteOrder::get_command() { return CMD_DELETE_ORDER; } -static constexpr auto _DeleteOrder_dispatch = MakeDispatchTable(); +static constexpr auto _DeleteOrder_dispatch = MakeDispatchTable(); bool DeleteOrder::_post(::CommandCallback *callback) { - return _DeleteOrder_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->veh_id, this->sel_ord); + return _DeleteOrder_dispatch[FindCallbackIndex(callback)](this->error, this->location, this->veh_id, this->sel_ord); } CommandCost DeleteOrder::_do(DoCommandFlag flags) { return (::Command::Do(flags, veh_id, sel_ord)); } Commands InsertOrder::get_command() { return CMD_INSERT_ORDER; } -static constexpr auto _InsertOrder_dispatch = MakeDispatchTable(); +static constexpr auto _InsertOrder_dispatch = MakeDispatchTable(); bool InsertOrder::_post(::CommandCallback *callback) { - return _InsertOrder_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->veh, this->sel_ord, this->new_order); + return _InsertOrder_dispatch[FindCallbackIndex(callback)](this->error, this->location, this->veh, this->sel_ord, this->new_order); } CommandCost InsertOrder::_do(DoCommandFlag flags) { return (::Command::Do(flags, veh, sel_ord, new_order)); } Commands OrderRefit::get_command() { return CMD_ORDER_REFIT; } -static constexpr auto _OrderRefit_dispatch = MakeDispatchTable(); +static constexpr auto _OrderRefit_dispatch = MakeDispatchTable(); bool OrderRefit::_post(::CommandCallback *callback) { - return _OrderRefit_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->veh, this->order_number, this->cargo); + return _OrderRefit_dispatch[FindCallbackIndex(callback)](this->error, this->location, this->veh, this->order_number, this->cargo); } CommandCost OrderRefit::_do(DoCommandFlag flags) { return (::Command::Do(flags, veh, order_number, cargo)); } Commands CloneOrder::get_command() { return CMD_CLONE_ORDER; } -static constexpr auto _CloneOrder_dispatch = MakeDispatchTable(); +static constexpr auto _CloneOrder_dispatch = MakeDispatchTable(); bool CloneOrder::_post(::CommandCallback *callback) { - return _CloneOrder_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->action, this->veh_dst, this->veh_src); + return _CloneOrder_dispatch[FindCallbackIndex(callback)](this->error, this->location, this->action, this->veh_dst, this->veh_src); } CommandCost CloneOrder::_do(DoCommandFlag flags) { return (::Command::Do(flags, action, veh_dst, veh_src)); } Commands MoveOrder::get_command() { return CMD_MOVE_ORDER; } -static constexpr auto _MoveOrder_dispatch = MakeDispatchTable(); +static constexpr auto _MoveOrder_dispatch = MakeDispatchTable(); bool MoveOrder::_post(::CommandCallback *callback) { - return _MoveOrder_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->veh, this->moving_order, this->target_order); + return _MoveOrder_dispatch[FindCallbackIndex(callback)](this->error, this->location, this->veh, this->moving_order, this->target_order); } CommandCost MoveOrder::_do(DoCommandFlag flags) { return (::Command::Do(flags, veh, moving_order, target_order)); } Commands ClearOrderBackup::get_command() { return CMD_CLEAR_ORDER_BACKUP; } -static constexpr auto _ClearOrderBackup_dispatch = MakeDispatchTable(); +static constexpr auto _ClearOrderBackup_dispatch = MakeDispatchTable(); bool ClearOrderBackup::_post(::CommandCallback *callback) { return _ClearOrderBackup_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->user_id); } CommandCost ClearOrderBackup::_do(DoCommandFlag flags) { - return (::Command::Do(flags, this->tile, user_id)); + return (::Command::Do(flags, tile, user_id)); } Commands MoneyCheat::get_command() { return CMD_MONEY_CHEAT; } static constexpr auto _MoneyCheat_dispatch = MakeDispatchTable(); bool MoneyCheat::_post(::CommandCallback *callback) { - return _MoneyCheat_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->amount); + return _MoneyCheat_dispatch[FindCallbackIndex(callback)](this->error, this->amount); } CommandCost MoneyCheat::_do(DoCommandFlag flags) { return (::Command::Do(flags, amount)); } Commands ChangeBankBalance::get_command() { return CMD_CHANGE_BANK_BALANCE; } -static constexpr auto _ChangeBankBalance_dispatch = MakeDispatchTable(); +static constexpr auto _ChangeBankBalance_dispatch = MakeDispatchTable(); bool ChangeBankBalance::_post(::CommandCallback *callback) { return _ChangeBankBalance_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->delta, this->company, this->expenses_type); } CommandCost ChangeBankBalance::_do(DoCommandFlag flags) { - return (::Command::Do(flags, this->tile, delta, company, expenses_type)); + return (::Command::Do(flags, tile, delta, company, expenses_type)); } Commands IncreaseLoan::get_command() { return CMD_INCREASE_LOAN; } static constexpr auto _IncreaseLoan_dispatch = MakeDispatchTable(); bool IncreaseLoan::_post(::CommandCallback *callback) { - return _IncreaseLoan_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->cmd, this->amount); + return _IncreaseLoan_dispatch[FindCallbackIndex(callback)](this->error, this->cmd, this->amount); } CommandCost IncreaseLoan::_do(DoCommandFlag flags) { return (::Command::Do(flags, cmd, amount)); @@ -1179,7 +1179,7 @@ CommandCost IncreaseLoan::_do(DoCommandFlag flags) { Commands DecreaseLoan::get_command() { return CMD_DECREASE_LOAN; } static constexpr auto _DecreaseLoan_dispatch = MakeDispatchTable(); bool DecreaseLoan::_post(::CommandCallback *callback) { - return _DecreaseLoan_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->cmd, this->amount); + return _DecreaseLoan_dispatch[FindCallbackIndex(callback)](this->error, this->cmd, this->amount); } CommandCost DecreaseLoan::_do(DoCommandFlag flags) { return (::Command::Do(flags, cmd, amount)); @@ -1188,7 +1188,7 @@ CommandCost DecreaseLoan::_do(DoCommandFlag flags) { Commands Pause::get_command() { return CMD_PAUSE; } static constexpr auto _Pause_dispatch = MakeDispatchTable(); bool Pause::_post(::CommandCallback *callback) { - return _Pause_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->mode, this->pause); + return _Pause_dispatch[FindCallbackIndex(callback)](this->error, this->mode, this->pause); } CommandCost Pause::_do(DoCommandFlag flags) { return (::Command::Do(flags, mode, pause)); @@ -1197,7 +1197,7 @@ CommandCost Pause::_do(DoCommandFlag flags) { Commands WantEnginePreview::get_command() { return CMD_WANT_ENGINE_PREVIEW; } static constexpr auto _WantEnginePreview_dispatch = MakeDispatchTable(); bool WantEnginePreview::_post(::CommandCallback *callback) { - return _WantEnginePreview_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->engine_id); + return _WantEnginePreview_dispatch[FindCallbackIndex(callback)](this->error, this->engine_id); } CommandCost WantEnginePreview::_do(DoCommandFlag flags) { return (::Command::Do(flags, engine_id)); @@ -1206,7 +1206,7 @@ CommandCost WantEnginePreview::_do(DoCommandFlag flags) { Commands EngineCtrl::get_command() { return CMD_ENGINE_CTRL; } static constexpr auto _EngineCtrl_dispatch = MakeDispatchTable(); bool EngineCtrl::_post(::CommandCallback *callback) { - return _EngineCtrl_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->engine_id, this->company_id, this->allow); + return _EngineCtrl_dispatch[FindCallbackIndex(callback)](this->error, this->engine_id, this->company_id, this->allow); } CommandCost EngineCtrl::_do(DoCommandFlag flags) { return (::Command::Do(flags, engine_id, company_id, allow)); @@ -1215,7 +1215,7 @@ CommandCost EngineCtrl::_do(DoCommandFlag flags) { Commands RenameEngine::get_command() { return CMD_RENAME_ENGINE; } static constexpr auto _RenameEngine_dispatch = MakeDispatchTable(); bool RenameEngine::_post(::CommandCallback *callback) { - return _RenameEngine_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->engine_id, this->text); + return _RenameEngine_dispatch[FindCallbackIndex(callback)](this->error, this->engine_id, this->text); } CommandCost RenameEngine::_do(DoCommandFlag flags) { return (::Command::Do(flags, engine_id, text)); @@ -1224,34 +1224,34 @@ CommandCost RenameEngine::_do(DoCommandFlag flags) { Commands SetVehicleVisibility::get_command() { return CMD_SET_VEHICLE_VISIBILITY; } static constexpr auto _SetVehicleVisibility_dispatch = MakeDispatchTable(); bool SetVehicleVisibility::_post(::CommandCallback *callback) { - return _SetVehicleVisibility_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->engine_id, this->hide); + return _SetVehicleVisibility_dispatch[FindCallbackIndex(callback)](this->error, this->engine_id, this->hide); } CommandCost SetVehicleVisibility::_do(DoCommandFlag flags) { return (::Command::Do(flags, engine_id, hide)); } Commands BuildBridge::get_command() { return CMD_BUILD_BRIDGE; } -static constexpr auto _BuildBridge_dispatch = MakeDispatchTable(); +static constexpr auto _BuildBridge_dispatch = MakeDispatchTable(); bool BuildBridge::_post(::CommandCallback *callback) { - return _BuildBridge_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->tile_start, this->transport_type, this->bridge_type, this->road_rail_type); + return _BuildBridge_dispatch[FindCallbackIndex(callback)](this->error, this->tile_end, this->tile_start, this->transport_type, this->bridge_type, this->road_rail_type); } CommandCost BuildBridge::_do(DoCommandFlag flags) { - return (::Command::Do(flags, this->tile, tile_start, transport_type, bridge_type, road_rail_type)); + return (::Command::Do(flags, tile_end, tile_start, transport_type, bridge_type, road_rail_type)); } Commands BuildTunnel::get_command() { return CMD_BUILD_TUNNEL; } -static constexpr auto _BuildTunnel_dispatch = MakeDispatchTable(); +static constexpr auto _BuildTunnel_dispatch = MakeDispatchTable(); bool BuildTunnel::_post(::CommandCallback *callback) { - return _BuildTunnel_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->transport_type, this->road_rail_type); + return _BuildTunnel_dispatch[FindCallbackIndex(callback)](this->error, this->start_tile, this->transport_type, this->road_rail_type); } CommandCost BuildTunnel::_do(DoCommandFlag flags) { - return (::Command::Do(flags, this->tile, transport_type, road_rail_type)); + return (::Command::Do(flags, start_tile, transport_type, road_rail_type)); } Commands CreateGroup::get_command() { return CMD_CREATE_GROUP; } static constexpr auto _CreateGroup_dispatch = MakeDispatchTable(); bool CreateGroup::_post(::CommandCallback *callback) { - return _CreateGroup_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->vt, this->parent_group); + return _CreateGroup_dispatch[FindCallbackIndex(callback)](this->error, this->vt, this->parent_group); } CommandCost CreateGroup::_do(DoCommandFlag flags) { return std::get<0>(::Command::Do(flags, vt, parent_group)); @@ -1260,7 +1260,7 @@ CommandCost CreateGroup::_do(DoCommandFlag flags) { Commands AlterGroup::get_command() { return CMD_ALTER_GROUP; } static constexpr auto _AlterGroup_dispatch = MakeDispatchTable(); bool AlterGroup::_post(::CommandCallback *callback) { - return _AlterGroup_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->mode, this->group_id, this->parent_id, this->text); + return _AlterGroup_dispatch[FindCallbackIndex(callback)](this->error, this->mode, this->group_id, this->parent_id, this->text); } CommandCost AlterGroup::_do(DoCommandFlag flags) { return (::Command::Do(flags, mode, group_id, parent_id, text)); @@ -1269,7 +1269,7 @@ CommandCost AlterGroup::_do(DoCommandFlag flags) { Commands DeleteGroup::get_command() { return CMD_DELETE_GROUP; } static constexpr auto _DeleteGroup_dispatch = MakeDispatchTable(); bool DeleteGroup::_post(::CommandCallback *callback) { - return _DeleteGroup_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->group_id); + return _DeleteGroup_dispatch[FindCallbackIndex(callback)](this->error, this->group_id); } CommandCost DeleteGroup::_do(DoCommandFlag flags) { return (::Command::Do(flags, group_id)); @@ -1278,7 +1278,7 @@ CommandCost DeleteGroup::_do(DoCommandFlag flags) { Commands AddVehicleGroup::get_command() { return CMD_ADD_VEHICLE_GROUP; } static constexpr auto _AddVehicleGroup_dispatch = MakeDispatchTable(); bool AddVehicleGroup::_post(::CommandCallback *callback) { - return _AddVehicleGroup_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->group_id, this->veh_id, this->add_shared); + return _AddVehicleGroup_dispatch[FindCallbackIndex(callback)](this->error, this->group_id, this->veh_id, this->add_shared); } CommandCost AddVehicleGroup::_do(DoCommandFlag flags) { return std::get<0>(::Command::Do(flags, group_id, veh_id, add_shared)); @@ -1287,7 +1287,7 @@ CommandCost AddVehicleGroup::_do(DoCommandFlag flags) { Commands AddSharedVehicleGroup::get_command() { return CMD_ADD_SHARED_VEHICLE_GROUP; } static constexpr auto _AddSharedVehicleGroup_dispatch = MakeDispatchTable(); bool AddSharedVehicleGroup::_post(::CommandCallback *callback) { - return _AddSharedVehicleGroup_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->id_g, this->type); + return _AddSharedVehicleGroup_dispatch[FindCallbackIndex(callback)](this->error, this->id_g, this->type); } CommandCost AddSharedVehicleGroup::_do(DoCommandFlag flags) { return (::Command::Do(flags, id_g, type)); @@ -1296,7 +1296,7 @@ CommandCost AddSharedVehicleGroup::_do(DoCommandFlag flags) { Commands RemoveAllVehiclesGroup::get_command() { return CMD_REMOVE_ALL_VEHICLES_GROUP; } static constexpr auto _RemoveAllVehiclesGroup_dispatch = MakeDispatchTable(); bool RemoveAllVehiclesGroup::_post(::CommandCallback *callback) { - return _RemoveAllVehiclesGroup_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->group_id); + return _RemoveAllVehiclesGroup_dispatch[FindCallbackIndex(callback)](this->error, this->group_id); } CommandCost RemoveAllVehiclesGroup::_do(DoCommandFlag flags) { return (::Command::Do(flags, group_id)); @@ -1305,7 +1305,7 @@ CommandCost RemoveAllVehiclesGroup::_do(DoCommandFlag flags) { Commands SetGroupFlag::get_command() { return CMD_SET_GROUP_FLAG; } static constexpr auto _SetGroupFlag_dispatch = MakeDispatchTable(); bool SetGroupFlag::_post(::CommandCallback *callback) { - return _SetGroupFlag_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->group_id, this->flag, this->value, this->recursive); + return _SetGroupFlag_dispatch[FindCallbackIndex(callback)](this->error, this->group_id, this->flag, this->value, this->recursive); } CommandCost SetGroupFlag::_do(DoCommandFlag flags) { return (::Command::Do(flags, group_id, flag, value, recursive)); @@ -1314,7 +1314,7 @@ CommandCost SetGroupFlag::_do(DoCommandFlag flags) { Commands SetGroupLivery::get_command() { return CMD_SET_GROUP_LIVERY; } static constexpr auto _SetGroupLivery_dispatch = MakeDispatchTable(); bool SetGroupLivery::_post(::CommandCallback *callback) { - return _SetGroupLivery_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->group_id, this->primary, this->colour); + return _SetGroupLivery_dispatch[FindCallbackIndex(callback)](this->error, this->group_id, this->primary, this->colour); } CommandCost SetGroupLivery::_do(DoCommandFlag flags) { return (::Command::Do(flags, group_id, primary, colour)); diff --git a/src/citymania/generated/cm_gen_commands.hpp b/src/citymania/generated/cm_gen_commands.hpp index 568f8944db..f4dcee5531 100644 --- a/src/citymania/generated/cm_gen_commands.hpp +++ b/src/citymania/generated/cm_gen_commands.hpp @@ -60,15 +60,14 @@ public: class CreateStoryPageElement: public Command { public: + TileIndex tile; StoryPageID page_id; StoryPageElementType type; uint32 reference; const std::string & text; - CreateStoryPageElement(StoryPageID page_id, StoryPageElementType type, uint32 reference, const std::string & text) - :page_id{page_id}, type{type}, reference{reference}, text{text} {} CreateStoryPageElement(TileIndex tile, StoryPageID page_id, StoryPageElementType type, uint32 reference, const std::string & text) - :Command{tile}, page_id{page_id}, type{type}, reference{reference}, text{text} {} + :tile{tile}, page_id{page_id}, type{type}, reference{reference}, text{text} {} ~CreateStoryPageElement() override {} bool _post(::CommandCallback * callback) override; @@ -78,14 +77,13 @@ public: class UpdateStoryPageElement: public Command { public: + TileIndex tile; StoryPageElementID page_element_id; uint32 reference; const std::string & text; - UpdateStoryPageElement(StoryPageElementID page_element_id, uint32 reference, const std::string & text) - :page_element_id{page_element_id}, reference{reference}, text{text} {} UpdateStoryPageElement(TileIndex tile, StoryPageElementID page_element_id, uint32 reference, const std::string & text) - :Command{tile}, page_element_id{page_element_id}, reference{reference}, text{text} {} + :tile{tile}, page_element_id{page_element_id}, reference{reference}, text{text} {} ~UpdateStoryPageElement() override {} bool _post(::CommandCallback * callback) override; @@ -162,13 +160,12 @@ public: class StoryPageButton: public Command { public: + TileIndex tile; StoryPageElementID page_element_id; VehicleID reference; - StoryPageButton(StoryPageElementID page_element_id, VehicleID reference) - :page_element_id{page_element_id}, reference{reference} {} StoryPageButton(TileIndex tile, StoryPageElementID page_element_id, VehicleID reference) - :Command{tile}, page_element_id{page_element_id}, reference{reference} {} + :tile{tile}, page_element_id{page_element_id}, reference{reference} {} ~StoryPageButton() override {} bool _post(::CommandCallback * callback) override; @@ -178,6 +175,7 @@ public: class BuildRailWaypoint: public Command { public: + TileIndex start_tile; Axis axis; byte width; byte height; @@ -186,10 +184,8 @@ public: StationID station_to_join; bool adjacent; - BuildRailWaypoint(Axis axis, byte width, byte height, StationClassID spec_class, byte spec_index, StationID station_to_join, bool adjacent) - :axis{axis}, width{width}, height{height}, spec_class{spec_class}, spec_index{spec_index}, station_to_join{station_to_join}, adjacent{adjacent} {} - BuildRailWaypoint(TileIndex tile, Axis axis, byte width, byte height, StationClassID spec_class, byte spec_index, StationID station_to_join, bool adjacent) - :Command{tile}, axis{axis}, width{width}, height{height}, spec_class{spec_class}, spec_index{spec_index}, station_to_join{station_to_join}, adjacent{adjacent} {} + BuildRailWaypoint(TileIndex start_tile, Axis axis, byte width, byte height, StationClassID spec_class, byte spec_index, StationID station_to_join, bool adjacent) + :start_tile{start_tile}, axis{axis}, width{width}, height{height}, spec_class{spec_class}, spec_index{spec_index}, station_to_join{station_to_join}, adjacent{adjacent} {} ~BuildRailWaypoint() override {} bool _post(::CommandCallback * callback) override; @@ -199,13 +195,12 @@ public: class RemoveFromRailWaypoint: public Command { public: + TileIndex start; TileIndex end; bool keep_rail; - RemoveFromRailWaypoint(TileIndex end, bool keep_rail) - :end{end}, keep_rail{keep_rail} {} - RemoveFromRailWaypoint(TileIndex tile, TileIndex end, bool keep_rail) - :Command{tile}, end{end}, keep_rail{keep_rail} {} + RemoveFromRailWaypoint(TileIndex start, TileIndex end, bool keep_rail) + :start{start}, end{end}, keep_rail{keep_rail} {} ~RemoveFromRailWaypoint() override {} bool _post(::CommandCallback * callback) override; @@ -215,10 +210,10 @@ public: class BuildBuoy: public Command { public: + TileIndex tile; - BuildBuoy() {} BuildBuoy(TileIndex tile) - :Command{tile} {} + :tile{tile} {} ~BuildBuoy() override {} bool _post(::CommandCallback * callback) override; @@ -242,15 +237,14 @@ public: class BuildAirport: public Command { public: + TileIndex tile; byte airport_type; byte layout; StationID station_to_join; bool adjacent; - BuildAirport(byte airport_type, byte layout, StationID station_to_join, bool adjacent) - :airport_type{airport_type}, layout{layout}, station_to_join{station_to_join}, adjacent{adjacent} {} BuildAirport(TileIndex tile, byte airport_type, byte layout, StationID station_to_join, bool adjacent) - :Command{tile}, airport_type{airport_type}, layout{layout}, station_to_join{station_to_join}, adjacent{adjacent} {} + :tile{tile}, airport_type{airport_type}, layout{layout}, station_to_join{station_to_join}, adjacent{adjacent} {} ~BuildAirport() override {} bool _post(::CommandCallback * callback) override; @@ -260,13 +254,12 @@ public: class BuildDock: public Command { public: + TileIndex tile; StationID station_to_join; bool adjacent; - BuildDock(StationID station_to_join, bool adjacent) - :station_to_join{station_to_join}, adjacent{adjacent} {} BuildDock(TileIndex tile, StationID station_to_join, bool adjacent) - :Command{tile}, station_to_join{station_to_join}, adjacent{adjacent} {} + :tile{tile}, station_to_join{station_to_join}, adjacent{adjacent} {} ~BuildDock() override {} bool _post(::CommandCallback * callback) override; @@ -276,6 +269,7 @@ public: class BuildRailStation: public Command { public: + TileIndex tile_org; RailType rt; Axis axis; byte numtracks; @@ -285,10 +279,8 @@ public: StationID station_to_join; bool adjacent; - BuildRailStation(RailType rt, Axis axis, byte numtracks, byte plat_len, StationClassID spec_class, byte spec_index, StationID station_to_join, bool adjacent) - :rt{rt}, axis{axis}, numtracks{numtracks}, plat_len{plat_len}, spec_class{spec_class}, spec_index{spec_index}, station_to_join{station_to_join}, adjacent{adjacent} {} - BuildRailStation(TileIndex tile, RailType rt, Axis axis, byte numtracks, byte plat_len, StationClassID spec_class, byte spec_index, StationID station_to_join, bool adjacent) - :Command{tile}, rt{rt}, axis{axis}, numtracks{numtracks}, plat_len{plat_len}, spec_class{spec_class}, spec_index{spec_index}, station_to_join{station_to_join}, adjacent{adjacent} {} + BuildRailStation(TileIndex tile_org, RailType rt, Axis axis, byte numtracks, byte plat_len, StationClassID spec_class, byte spec_index, StationID station_to_join, bool adjacent) + :tile_org{tile_org}, rt{rt}, axis{axis}, numtracks{numtracks}, plat_len{plat_len}, spec_class{spec_class}, spec_index{spec_index}, station_to_join{station_to_join}, adjacent{adjacent} {} ~BuildRailStation() override {} bool _post(::CommandCallback * callback) override; @@ -298,13 +290,12 @@ public: class RemoveFromRailStation: public Command { public: + TileIndex start; TileIndex end; bool keep_rail; - RemoveFromRailStation(TileIndex end, bool keep_rail) - :end{end}, keep_rail{keep_rail} {} - RemoveFromRailStation(TileIndex tile, TileIndex end, bool keep_rail) - :Command{tile}, end{end}, keep_rail{keep_rail} {} + RemoveFromRailStation(TileIndex start, TileIndex end, bool keep_rail) + :start{start}, end{end}, keep_rail{keep_rail} {} ~RemoveFromRailStation() override {} bool _post(::CommandCallback * callback) override; @@ -314,6 +305,7 @@ public: class BuildRoadStop: public Command { public: + TileIndex tile; uint8 width; uint8 length; RoadStopType stop_type; @@ -323,10 +315,8 @@ public: StationID station_to_join; bool adjacent; - BuildRoadStop(uint8 width, uint8 length, RoadStopType stop_type, bool is_drive_through, DiagDirection ddir, RoadType rt, StationID station_to_join, bool adjacent) - :width{width}, length{length}, stop_type{stop_type}, is_drive_through{is_drive_through}, ddir{ddir}, rt{rt}, station_to_join{station_to_join}, adjacent{adjacent} {} BuildRoadStop(TileIndex tile, uint8 width, uint8 length, RoadStopType stop_type, bool is_drive_through, DiagDirection ddir, RoadType rt, StationID station_to_join, bool adjacent) - :Command{tile}, width{width}, length{length}, stop_type{stop_type}, is_drive_through{is_drive_through}, ddir{ddir}, rt{rt}, station_to_join{station_to_join}, adjacent{adjacent} {} + :tile{tile}, width{width}, length{length}, stop_type{stop_type}, is_drive_through{is_drive_through}, ddir{ddir}, rt{rt}, station_to_join{station_to_join}, adjacent{adjacent} {} ~BuildRoadStop() override {} bool _post(::CommandCallback * callback) override; @@ -336,15 +326,14 @@ public: class RemoveRoadStop: public Command { public: + TileIndex tile; uint8 width; uint8 height; RoadStopType stop_type; bool remove_road; - RemoveRoadStop(uint8 width, uint8 height, RoadStopType stop_type, bool remove_road) - :width{width}, height{height}, stop_type{stop_type}, remove_road{remove_road} {} RemoveRoadStop(TileIndex tile, uint8 width, uint8 height, RoadStopType stop_type, bool remove_road) - :Command{tile}, width{width}, height{height}, stop_type{stop_type}, remove_road{remove_road} {} + :tile{tile}, width{width}, height{height}, stop_type{stop_type}, remove_road{remove_road} {} ~RemoveRoadStop() override {} bool _post(::CommandCallback * callback) override; @@ -529,13 +518,12 @@ public: class BuildObject: public Command { public: + TileIndex tile; ObjectType type; uint8 view; - BuildObject(ObjectType type, uint8 view) - :type{type}, view{view} {} BuildObject(TileIndex tile, ObjectType type, uint8 view) - :Command{tile}, type{type}, view{view} {} + :tile{tile}, type{type}, view{view} {} ~BuildObject() override {} bool _post(::CommandCallback * callback) override; @@ -545,15 +533,14 @@ public: class BuildObjectArea: public Command { public: + TileIndex tile; TileIndex start_tile; ObjectType type; uint8 view; bool diagonal; - BuildObjectArea(TileIndex start_tile, ObjectType type, uint8 view, bool diagonal) - :start_tile{start_tile}, type{type}, view{view}, diagonal{diagonal} {} BuildObjectArea(TileIndex tile, TileIndex start_tile, ObjectType type, uint8 view, bool diagonal) - :Command{tile}, start_tile{start_tile}, type{type}, view{view}, diagonal{diagonal} {} + :tile{tile}, start_tile{start_tile}, type{type}, view{view}, diagonal{diagonal} {} ~BuildObjectArea() override {} bool _post(::CommandCallback * callback) override; @@ -563,12 +550,11 @@ public: class BuildShipDepot: public Command { public: + TileIndex tile; Axis axis; - BuildShipDepot(Axis axis) - :axis{axis} {} BuildShipDepot(TileIndex tile, Axis axis) - :Command{tile}, axis{axis} {} + :tile{tile}, axis{axis} {} ~BuildShipDepot() override {} bool _post(::CommandCallback * callback) override; @@ -578,14 +564,13 @@ public: class BuildCanal: public Command { public: + TileIndex tile; TileIndex start_tile; WaterClass wc; bool diagonal; - BuildCanal(TileIndex start_tile, WaterClass wc, bool diagonal) - :start_tile{start_tile}, wc{wc}, diagonal{diagonal} {} BuildCanal(TileIndex tile, TileIndex start_tile, WaterClass wc, bool diagonal) - :Command{tile}, start_tile{start_tile}, wc{wc}, diagonal{diagonal} {} + :tile{tile}, start_tile{start_tile}, wc{wc}, diagonal{diagonal} {} ~BuildCanal() override {} bool _post(::CommandCallback * callback) override; @@ -595,10 +580,10 @@ public: class BuildLock: public Command { public: + TileIndex tile; - BuildLock() {} BuildLock(TileIndex tile) - :Command{tile} {} + :tile{tile} {} ~BuildLock() override {} bool _post(::CommandCallback * callback) override; @@ -608,6 +593,7 @@ public: class BuildLongRoad: public Command { public: + TileIndex end_tile; TileIndex start_tile; RoadType rt; Axis axis; @@ -616,10 +602,8 @@ public: bool end_half; bool is_ai; - BuildLongRoad(TileIndex start_tile, RoadType rt, Axis axis, DisallowedRoadDirections drd, bool start_half, bool end_half, bool is_ai) - :start_tile{start_tile}, rt{rt}, axis{axis}, drd{drd}, start_half{start_half}, end_half{end_half}, is_ai{is_ai} {} - BuildLongRoad(TileIndex tile, TileIndex start_tile, RoadType rt, Axis axis, DisallowedRoadDirections drd, bool start_half, bool end_half, bool is_ai) - :Command{tile}, start_tile{start_tile}, rt{rt}, axis{axis}, drd{drd}, start_half{start_half}, end_half{end_half}, is_ai{is_ai} {} + BuildLongRoad(TileIndex end_tile, TileIndex start_tile, RoadType rt, Axis axis, DisallowedRoadDirections drd, bool start_half, bool end_half, bool is_ai) + :end_tile{end_tile}, start_tile{start_tile}, rt{rt}, axis{axis}, drd{drd}, start_half{start_half}, end_half{end_half}, is_ai{is_ai} {} ~BuildLongRoad() override {} bool _post(::CommandCallback * callback) override; @@ -629,16 +613,15 @@ public: class RemoveLongRoad: public Command { public: + TileIndex end_tile; TileIndex start_tile; RoadType rt; Axis axis; bool start_half; bool end_half; - RemoveLongRoad(TileIndex start_tile, RoadType rt, Axis axis, bool start_half, bool end_half) - :start_tile{start_tile}, rt{rt}, axis{axis}, start_half{start_half}, end_half{end_half} {} - RemoveLongRoad(TileIndex tile, TileIndex start_tile, RoadType rt, Axis axis, bool start_half, bool end_half) - :Command{tile}, start_tile{start_tile}, rt{rt}, axis{axis}, start_half{start_half}, end_half{end_half} {} + RemoveLongRoad(TileIndex end_tile, TileIndex start_tile, RoadType rt, Axis axis, bool start_half, bool end_half) + :end_tile{end_tile}, start_tile{start_tile}, rt{rt}, axis{axis}, start_half{start_half}, end_half{end_half} {} ~RemoveLongRoad() override {} bool _post(::CommandCallback * callback) override; @@ -648,15 +631,14 @@ public: class BuildRoad: public Command { public: + TileIndex tile; RoadBits pieces; RoadType rt; DisallowedRoadDirections toggle_drd; TownID town_id; - BuildRoad(RoadBits pieces, RoadType rt, DisallowedRoadDirections toggle_drd, TownID town_id) - :pieces{pieces}, rt{rt}, toggle_drd{toggle_drd}, town_id{town_id} {} BuildRoad(TileIndex tile, RoadBits pieces, RoadType rt, DisallowedRoadDirections toggle_drd, TownID town_id) - :Command{tile}, pieces{pieces}, rt{rt}, toggle_drd{toggle_drd}, town_id{town_id} {} + :tile{tile}, pieces{pieces}, rt{rt}, toggle_drd{toggle_drd}, town_id{town_id} {} ~BuildRoad() override {} bool _post(::CommandCallback * callback) override; @@ -666,13 +648,12 @@ public: class BuildRoadDepot: public Command { public: + TileIndex tile; RoadType rt; DiagDirection dir; - BuildRoadDepot(RoadType rt, DiagDirection dir) - :rt{rt}, dir{dir} {} BuildRoadDepot(TileIndex tile, RoadType rt, DiagDirection dir) - :Command{tile}, rt{rt}, dir{dir} {} + :tile{tile}, rt{rt}, dir{dir} {} ~BuildRoadDepot() override {} bool _post(::CommandCallback * callback) override; @@ -682,13 +663,12 @@ public: class ConvertRoad: public Command { public: + TileIndex tile; TileIndex area_start; RoadType to_type; - ConvertRoad(TileIndex area_start, RoadType to_type) - :area_start{area_start}, to_type{to_type} {} ConvertRoad(TileIndex tile, TileIndex area_start, RoadType to_type) - :Command{tile}, area_start{area_start}, to_type{to_type} {} + :tile{tile}, area_start{area_start}, to_type{to_type} {} ~ConvertRoad() override {} bool _post(::CommandCallback * callback) override; @@ -737,10 +717,10 @@ public: class LandscapeClear: public Command { public: + TileIndex tile; - LandscapeClear() {} LandscapeClear(TileIndex tile) - :Command{tile} {} + :tile{tile} {} ~LandscapeClear() override {} bool _post(::CommandCallback * callback) override; @@ -750,13 +730,12 @@ public: class ClearArea: public Command { public: + TileIndex tile; TileIndex start_tile; bool diagonal; - ClearArea(TileIndex start_tile, bool diagonal) - :start_tile{start_tile}, diagonal{diagonal} {} ClearArea(TileIndex tile, TileIndex start_tile, bool diagonal) - :Command{tile}, start_tile{start_tile}, diagonal{diagonal} {} + :tile{tile}, start_tile{start_tile}, diagonal{diagonal} {} ~ClearArea() override {} bool _post(::CommandCallback * callback) override; @@ -766,12 +745,13 @@ public: class MoveRailVehicle: public Command { public: + TileIndex location; VehicleID src_veh; VehicleID dest_veh; bool move_chain; - MoveRailVehicle(VehicleID src_veh, VehicleID dest_veh, bool move_chain) - :src_veh{src_veh}, dest_veh{dest_veh}, move_chain{move_chain} {} + MoveRailVehicle(TileIndex location, VehicleID src_veh, VehicleID dest_veh, bool move_chain) + :location{location}, src_veh{src_veh}, dest_veh{dest_veh}, move_chain{move_chain} {} ~MoveRailVehicle() override {} bool _post(::CommandCallback * callback) override; @@ -781,10 +761,11 @@ public: class ForceTrainProceed: public Command { public: + TileIndex location; VehicleID veh_id; - ForceTrainProceed(VehicleID veh_id) - :veh_id{veh_id} {} + ForceTrainProceed(TileIndex location, VehicleID veh_id) + :location{location}, veh_id{veh_id} {} ~ForceTrainProceed() override {} bool _post(::CommandCallback * callback) override; @@ -794,11 +775,12 @@ public: class ReverseTrainDirection: public Command { public: + TileIndex location; VehicleID veh_id; bool reverse_single_veh; - ReverseTrainDirection(VehicleID veh_id, bool reverse_single_veh) - :veh_id{veh_id}, reverse_single_veh{reverse_single_veh} {} + ReverseTrainDirection(TileIndex location, VehicleID veh_id, bool reverse_single_veh) + :location{location}, veh_id{veh_id}, reverse_single_veh{reverse_single_veh} {} ~ReverseTrainDirection() override {} bool _post(::CommandCallback * callback) override; @@ -825,13 +807,12 @@ public: class ScrollViewport: public Command { public: + TileIndex tile; ViewportScrollTarget target; uint32 ref; - ScrollViewport(ViewportScrollTarget target, uint32 ref) - :target{target}, ref{ref} {} ScrollViewport(TileIndex tile, ViewportScrollTarget target, uint32 ref) - :Command{tile}, target{target}, ref{ref} {} + :tile{tile}, target{target}, ref{ref} {} ~ScrollViewport() override {} bool _post(::CommandCallback * callback) override; @@ -915,14 +896,13 @@ public: class PlantTree: public Command { public: + TileIndex tile; TileIndex start_tile; byte tree_to_plant; bool diagonal; - PlantTree(TileIndex start_tile, byte tree_to_plant, bool diagonal) - :start_tile{start_tile}, tree_to_plant{tree_to_plant}, diagonal{diagonal} {} PlantTree(TileIndex tile, TileIndex start_tile, byte tree_to_plant, bool diagonal) - :Command{tile}, start_tile{start_tile}, tree_to_plant{tree_to_plant}, diagonal{diagonal} {} + :tile{tile}, start_tile{start_tile}, tree_to_plant{tree_to_plant}, diagonal{diagonal} {} ~PlantTree() override {} bool _post(::CommandCallback * callback) override; @@ -1011,12 +991,11 @@ public: class PlaceSign: public Command { public: + TileIndex tile; const std::string & text; - PlaceSign(const std::string & text) - :text{text} {} PlaceSign(TileIndex tile, const std::string & text) - :Command{tile}, text{text} {} + :tile{tile}, text{text} {} ~PlaceSign() override {} bool _post(::CommandCallback * callback) override; @@ -1040,15 +1019,14 @@ public: class BuildVehicle: public Command { public: + TileIndex tile; EngineID eid; bool use_free_vehicles; CargoID cargo; ClientID client_id; - BuildVehicle(EngineID eid, bool use_free_vehicles, CargoID cargo, ClientID client_id) - :eid{eid}, use_free_vehicles{use_free_vehicles}, cargo{cargo}, client_id{client_id} {} BuildVehicle(TileIndex tile, EngineID eid, bool use_free_vehicles, CargoID cargo, ClientID client_id) - :Command{tile}, eid{eid}, use_free_vehicles{use_free_vehicles}, cargo{cargo}, client_id{client_id} {} + :tile{tile}, eid{eid}, use_free_vehicles{use_free_vehicles}, cargo{cargo}, client_id{client_id} {} ~BuildVehicle() override {} bool _post(::CommandCallback * callback) override; @@ -1058,13 +1036,14 @@ public: class SellVehicle: public Command { public: + TileIndex location; VehicleID v_id; bool sell_chain; bool backup_order; ClientID client_id; - SellVehicle(VehicleID v_id, bool sell_chain, bool backup_order, ClientID client_id) - :v_id{v_id}, sell_chain{sell_chain}, backup_order{backup_order}, client_id{client_id} {} + SellVehicle(TileIndex location, VehicleID v_id, bool sell_chain, bool backup_order, ClientID client_id) + :location{location}, v_id{v_id}, sell_chain{sell_chain}, backup_order{backup_order}, client_id{client_id} {} ~SellVehicle() override {} bool _post(::CommandCallback * callback) override; @@ -1074,6 +1053,7 @@ public: class RefitVehicle: public Command { public: + TileIndex location; VehicleID veh_id; CargoID new_cid; byte new_subtype; @@ -1081,8 +1061,8 @@ public: bool only_this; uint8 num_vehicles; - RefitVehicle(VehicleID veh_id, CargoID new_cid, byte new_subtype, bool auto_refit, bool only_this, uint8 num_vehicles) - :veh_id{veh_id}, new_cid{new_cid}, new_subtype{new_subtype}, auto_refit{auto_refit}, only_this{only_this}, num_vehicles{num_vehicles} {} + RefitVehicle(TileIndex location, VehicleID veh_id, CargoID new_cid, byte new_subtype, bool auto_refit, bool only_this, uint8 num_vehicles) + :location{location}, veh_id{veh_id}, new_cid{new_cid}, new_subtype{new_subtype}, auto_refit{auto_refit}, only_this{only_this}, num_vehicles{num_vehicles} {} ~RefitVehicle() override {} bool _post(::CommandCallback * callback) override; @@ -1137,13 +1117,12 @@ public: class CloneVehicle: public Command { public: + TileIndex tile; VehicleID veh_id; bool share_orders; - CloneVehicle(VehicleID veh_id, bool share_orders) - :veh_id{veh_id}, share_orders{share_orders} {} CloneVehicle(TileIndex tile, VehicleID veh_id, bool share_orders) - :Command{tile}, veh_id{veh_id}, share_orders{share_orders} {} + :tile{tile}, veh_id{veh_id}, share_orders{share_orders} {} ~CloneVehicle() override {} bool _post(::CommandCallback * callback) override; @@ -1153,11 +1132,12 @@ public: class StartStopVehicle: public Command { public: + TileIndex location; VehicleID veh_id; bool evaluate_startstop_cb; - StartStopVehicle(VehicleID veh_id, bool evaluate_startstop_cb) - :veh_id{veh_id}, evaluate_startstop_cb{evaluate_startstop_cb} {} + StartStopVehicle(TileIndex location, VehicleID veh_id, bool evaluate_startstop_cb) + :location{location}, veh_id{veh_id}, evaluate_startstop_cb{evaluate_startstop_cb} {} ~StartStopVehicle() override {} bool _post(::CommandCallback * callback) override; @@ -1167,14 +1147,13 @@ public: class MassStartStopVehicle: public Command { public: + TileIndex tile; bool do_start; bool vehicle_list_window; const VehicleListIdentifier & vli; - MassStartStopVehicle(bool do_start, bool vehicle_list_window, const VehicleListIdentifier & vli) - :do_start{do_start}, vehicle_list_window{vehicle_list_window}, vli{vli} {} MassStartStopVehicle(TileIndex tile, bool do_start, bool vehicle_list_window, const VehicleListIdentifier & vli) - :Command{tile}, do_start{do_start}, vehicle_list_window{vehicle_list_window}, vli{vli} {} + :tile{tile}, do_start{do_start}, vehicle_list_window{vehicle_list_window}, vli{vli} {} ~MassStartStopVehicle() override {} bool _post(::CommandCallback * callback) override; @@ -1184,12 +1163,11 @@ public: class DepotSellAllVehicles: public Command { public: + TileIndex tile; VehicleType vehicle_type; - DepotSellAllVehicles(VehicleType vehicle_type) - :vehicle_type{vehicle_type} {} DepotSellAllVehicles(TileIndex tile, VehicleType vehicle_type) - :Command{tile}, vehicle_type{vehicle_type} {} + :tile{tile}, vehicle_type{vehicle_type} {} ~DepotSellAllVehicles() override {} bool _post(::CommandCallback * callback) override; @@ -1199,12 +1177,11 @@ public: class DepotMassAutoReplace: public Command { public: + TileIndex tile; VehicleType vehicle_type; - DepotMassAutoReplace(VehicleType vehicle_type) - :vehicle_type{vehicle_type} {} DepotMassAutoReplace(TileIndex tile, VehicleType vehicle_type) - :Command{tile}, vehicle_type{vehicle_type} {} + :tile{tile}, vehicle_type{vehicle_type} {} ~DepotMassAutoReplace() override {} bool _post(::CommandCallback * callback) override; @@ -1214,13 +1191,12 @@ public: class TerraformLand: public Command { public: + TileIndex tile; Slope slope; bool dir_up; - TerraformLand(Slope slope, bool dir_up) - :slope{slope}, dir_up{dir_up} {} TerraformLand(TileIndex tile, Slope slope, bool dir_up) - :Command{tile}, slope{slope}, dir_up{dir_up} {} + :tile{tile}, slope{slope}, dir_up{dir_up} {} ~TerraformLand() override {} bool _post(::CommandCallback * callback) override; @@ -1230,14 +1206,13 @@ public: class LevelLand: public Command { public: + TileIndex tile; TileIndex start_tile; bool diagonal; LevelMode lm; - LevelLand(TileIndex start_tile, bool diagonal, LevelMode lm) - :start_tile{start_tile}, diagonal{diagonal}, lm{lm} {} LevelLand(TileIndex tile, TileIndex start_tile, bool diagonal, LevelMode lm) - :Command{tile}, start_tile{start_tile}, diagonal{diagonal}, lm{lm} {} + :tile{tile}, start_tile{start_tile}, diagonal{diagonal}, lm{lm} {} ~LevelLand() override {} bool _post(::CommandCallback * callback) override; @@ -1261,16 +1236,15 @@ public: class BuildRailroadTrack: public Command { public: + TileIndex end_tile; TileIndex start_tile; RailType railtype; Track track; bool auto_remove_signals; bool fail_on_obstacle; - BuildRailroadTrack(TileIndex start_tile, RailType railtype, Track track, bool auto_remove_signals, bool fail_on_obstacle) - :start_tile{start_tile}, railtype{railtype}, track{track}, auto_remove_signals{auto_remove_signals}, fail_on_obstacle{fail_on_obstacle} {} - BuildRailroadTrack(TileIndex tile, TileIndex start_tile, RailType railtype, Track track, bool auto_remove_signals, bool fail_on_obstacle) - :Command{tile}, start_tile{start_tile}, railtype{railtype}, track{track}, auto_remove_signals{auto_remove_signals}, fail_on_obstacle{fail_on_obstacle} {} + BuildRailroadTrack(TileIndex end_tile, TileIndex start_tile, RailType railtype, Track track, bool auto_remove_signals, bool fail_on_obstacle) + :end_tile{end_tile}, start_tile{start_tile}, railtype{railtype}, track{track}, auto_remove_signals{auto_remove_signals}, fail_on_obstacle{fail_on_obstacle} {} ~BuildRailroadTrack() override {} bool _post(::CommandCallback * callback) override; @@ -1280,13 +1254,12 @@ public: class RemoveRailroadTrack: public Command { public: + TileIndex end_tile; TileIndex start_tile; Track track; - RemoveRailroadTrack(TileIndex start_tile, Track track) - :start_tile{start_tile}, track{track} {} - RemoveRailroadTrack(TileIndex tile, TileIndex start_tile, Track track) - :Command{tile}, start_tile{start_tile}, track{track} {} + RemoveRailroadTrack(TileIndex end_tile, TileIndex start_tile, Track track) + :end_tile{end_tile}, start_tile{start_tile}, track{track} {} ~RemoveRailroadTrack() override {} bool _post(::CommandCallback * callback) override; @@ -1296,14 +1269,13 @@ public: class BuildSingleRail: public Command { public: + TileIndex tile; RailType railtype; Track track; bool auto_remove_signals; - BuildSingleRail(RailType railtype, Track track, bool auto_remove_signals) - :railtype{railtype}, track{track}, auto_remove_signals{auto_remove_signals} {} BuildSingleRail(TileIndex tile, RailType railtype, Track track, bool auto_remove_signals) - :Command{tile}, railtype{railtype}, track{track}, auto_remove_signals{auto_remove_signals} {} + :tile{tile}, railtype{railtype}, track{track}, auto_remove_signals{auto_remove_signals} {} ~BuildSingleRail() override {} bool _post(::CommandCallback * callback) override; @@ -1313,12 +1285,11 @@ public: class RemoveSingleRail: public Command { public: + TileIndex tile; Track track; - RemoveSingleRail(Track track) - :track{track} {} RemoveSingleRail(TileIndex tile, Track track) - :Command{tile}, track{track} {} + :tile{tile}, track{track} {} ~RemoveSingleRail() override {} bool _post(::CommandCallback * callback) override; @@ -1328,13 +1299,12 @@ public: class BuildTrainDepot: public Command { public: + TileIndex tile; RailType railtype; DiagDirection dir; - BuildTrainDepot(RailType railtype, DiagDirection dir) - :railtype{railtype}, dir{dir} {} BuildTrainDepot(TileIndex tile, RailType railtype, DiagDirection dir) - :Command{tile}, railtype{railtype}, dir{dir} {} + :tile{tile}, railtype{railtype}, dir{dir} {} ~BuildTrainDepot() override {} bool _post(::CommandCallback * callback) override; @@ -1344,6 +1314,7 @@ public: class BuildSingleSignal: public Command { public: + TileIndex tile; Track track; SignalType sigtype; SignalVariant sigvar; @@ -1355,10 +1326,8 @@ public: uint8 num_dir_cycle; byte signals_copy; - BuildSingleSignal(Track track, SignalType sigtype, SignalVariant sigvar, bool convert_signal, bool skip_existing_signals, bool ctrl_pressed, SignalType cycle_start, SignalType cycle_stop, uint8 num_dir_cycle, byte signals_copy) - :track{track}, sigtype{sigtype}, sigvar{sigvar}, convert_signal{convert_signal}, skip_existing_signals{skip_existing_signals}, ctrl_pressed{ctrl_pressed}, cycle_start{cycle_start}, cycle_stop{cycle_stop}, num_dir_cycle{num_dir_cycle}, signals_copy{signals_copy} {} BuildSingleSignal(TileIndex tile, Track track, SignalType sigtype, SignalVariant sigvar, bool convert_signal, bool skip_existing_signals, bool ctrl_pressed, SignalType cycle_start, SignalType cycle_stop, uint8 num_dir_cycle, byte signals_copy) - :Command{tile}, track{track}, sigtype{sigtype}, sigvar{sigvar}, convert_signal{convert_signal}, skip_existing_signals{skip_existing_signals}, ctrl_pressed{ctrl_pressed}, cycle_start{cycle_start}, cycle_stop{cycle_stop}, num_dir_cycle{num_dir_cycle}, signals_copy{signals_copy} {} + :tile{tile}, track{track}, sigtype{sigtype}, sigvar{sigvar}, convert_signal{convert_signal}, skip_existing_signals{skip_existing_signals}, ctrl_pressed{ctrl_pressed}, cycle_start{cycle_start}, cycle_stop{cycle_stop}, num_dir_cycle{num_dir_cycle}, signals_copy{signals_copy} {} ~BuildSingleSignal() override {} bool _post(::CommandCallback * callback) override; @@ -1368,12 +1337,11 @@ public: class RemoveSingleSignal: public Command { public: + TileIndex tile; Track track; - RemoveSingleSignal(Track track) - :track{track} {} RemoveSingleSignal(TileIndex tile, Track track) - :Command{tile}, track{track} {} + :tile{tile}, track{track} {} ~RemoveSingleSignal() override {} bool _post(::CommandCallback * callback) override; @@ -1383,14 +1351,13 @@ public: class ConvertRail: public Command { public: + TileIndex tile; TileIndex area_start; RailType totype; bool diagonal; - ConvertRail(TileIndex area_start, RailType totype, bool diagonal) - :area_start{area_start}, totype{totype}, diagonal{diagonal} {} ConvertRail(TileIndex tile, TileIndex area_start, RailType totype, bool diagonal) - :Command{tile}, area_start{area_start}, totype{totype}, diagonal{diagonal} {} + :tile{tile}, area_start{area_start}, totype{totype}, diagonal{diagonal} {} ~ConvertRail() override {} bool _post(::CommandCallback * callback) override; @@ -1400,6 +1367,7 @@ public: class BuildSignalTrack: public Command { public: + TileIndex tile; TileIndex end_tile; Track track; SignalType sigtype; @@ -1409,10 +1377,8 @@ public: bool minimise_gaps; byte signal_density; - BuildSignalTrack(TileIndex end_tile, Track track, SignalType sigtype, SignalVariant sigvar, bool mode, bool autofill, bool minimise_gaps, byte signal_density) - :end_tile{end_tile}, track{track}, sigtype{sigtype}, sigvar{sigvar}, mode{mode}, autofill{autofill}, minimise_gaps{minimise_gaps}, signal_density{signal_density} {} BuildSignalTrack(TileIndex tile, TileIndex end_tile, Track track, SignalType sigtype, SignalVariant sigvar, bool mode, bool autofill, bool minimise_gaps, byte signal_density) - :Command{tile}, end_tile{end_tile}, track{track}, sigtype{sigtype}, sigvar{sigvar}, mode{mode}, autofill{autofill}, minimise_gaps{minimise_gaps}, signal_density{signal_density} {} + :tile{tile}, end_tile{end_tile}, track{track}, sigtype{sigtype}, sigvar{sigvar}, mode{mode}, autofill{autofill}, minimise_gaps{minimise_gaps}, signal_density{signal_density} {} ~BuildSignalTrack() override {} bool _post(::CommandCallback * callback) override; @@ -1422,14 +1388,13 @@ public: class RemoveSignalTrack: public Command { public: + TileIndex tile; TileIndex end_tile; Track track; bool autofill; - RemoveSignalTrack(TileIndex end_tile, Track track, bool autofill) - :end_tile{end_tile}, track{track}, autofill{autofill} {} RemoveSignalTrack(TileIndex tile, TileIndex end_tile, Track track, bool autofill) - :Command{tile}, end_tile{end_tile}, track{track}, autofill{autofill} {} + :tile{tile}, end_tile{end_tile}, track{track}, autofill{autofill} {} ~RemoveSignalTrack() override {} bool _post(::CommandCallback * callback) override; @@ -1552,6 +1517,7 @@ public: class FoundTown: public Command { public: + TileIndex tile; TownSize size; bool city; TownLayout layout; @@ -1559,10 +1525,8 @@ public: uint32 townnameparts; const std::string & text; - FoundTown(TownSize size, bool city, TownLayout layout, bool random_location, uint32 townnameparts, const std::string & text) - :size{size}, city{city}, layout{layout}, random_location{random_location}, townnameparts{townnameparts}, text{text} {} FoundTown(TileIndex tile, TownSize size, bool city, TownLayout layout, bool random_location, uint32 townnameparts, const std::string & text) - :Command{tile}, size{size}, city{city}, layout{layout}, random_location{random_location}, townnameparts{townnameparts}, text{text} {} + :tile{tile}, size{size}, city{city}, layout{layout}, random_location{random_location}, townnameparts{townnameparts}, text{text} {} ~FoundTown() override {} bool _post(::CommandCallback * callback) override; @@ -1586,11 +1550,12 @@ public: class DoTownAction: public Command { public: + TileIndex location; TownID town_id; uint8 action; - DoTownAction(TownID town_id, uint8 action) - :town_id{town_id}, action{action} {} + DoTownAction(TileIndex location, TownID town_id, uint8 action) + :location{location}, town_id{town_id}, action{action} {} ~DoTownAction() override {} bool _post(::CommandCallback * callback) override; @@ -1685,10 +1650,11 @@ public: class TurnRoadVeh: public Command { public: + TileIndex location; VehicleID veh_id; - TurnRoadVeh(VehicleID veh_id) - :veh_id{veh_id} {} + TurnRoadVeh(TileIndex location, VehicleID veh_id) + :location{location}, veh_id{veh_id} {} ~TurnRoadVeh() override {} bool _post(::CommandCallback * callback) override; @@ -1698,15 +1664,14 @@ public: class BuildIndustry: public Command { public: + TileIndex tile; IndustryType it; uint32 first_layout; bool fund; uint32 seed; - BuildIndustry(IndustryType it, uint32 first_layout, bool fund, uint32 seed) - :it{it}, first_layout{first_layout}, fund{fund}, seed{seed} {} BuildIndustry(TileIndex tile, IndustryType it, uint32 first_layout, bool fund, uint32 seed) - :Command{tile}, it{it}, first_layout{first_layout}, fund{fund}, seed{seed} {} + :tile{tile}, it{it}, first_layout{first_layout}, fund{fund}, seed{seed} {} ~BuildIndustry() override {} bool _post(::CommandCallback * callback) override; @@ -1733,13 +1698,14 @@ public: class ModifyOrder: public Command { public: + TileIndex location; VehicleID veh; VehicleOrderID sel_ord; ModifyOrderFlags mof; uint16 data; - ModifyOrder(VehicleID veh, VehicleOrderID sel_ord, ModifyOrderFlags mof, uint16 data) - :veh{veh}, sel_ord{sel_ord}, mof{mof}, data{data} {} + ModifyOrder(TileIndex location, VehicleID veh, VehicleOrderID sel_ord, ModifyOrderFlags mof, uint16 data) + :location{location}, veh{veh}, sel_ord{sel_ord}, mof{mof}, data{data} {} ~ModifyOrder() override {} bool _post(::CommandCallback * callback) override; @@ -1749,11 +1715,12 @@ public: class SkipToOrder: public Command { public: + TileIndex location; VehicleID veh_id; VehicleOrderID sel_ord; - SkipToOrder(VehicleID veh_id, VehicleOrderID sel_ord) - :veh_id{veh_id}, sel_ord{sel_ord} {} + SkipToOrder(TileIndex location, VehicleID veh_id, VehicleOrderID sel_ord) + :location{location}, veh_id{veh_id}, sel_ord{sel_ord} {} ~SkipToOrder() override {} bool _post(::CommandCallback * callback) override; @@ -1763,11 +1730,12 @@ public: class DeleteOrder: public Command { public: + TileIndex location; VehicleID veh_id; VehicleOrderID sel_ord; - DeleteOrder(VehicleID veh_id, VehicleOrderID sel_ord) - :veh_id{veh_id}, sel_ord{sel_ord} {} + DeleteOrder(TileIndex location, VehicleID veh_id, VehicleOrderID sel_ord) + :location{location}, veh_id{veh_id}, sel_ord{sel_ord} {} ~DeleteOrder() override {} bool _post(::CommandCallback * callback) override; @@ -1777,12 +1745,13 @@ public: class InsertOrder: public Command { public: + TileIndex location; VehicleID veh; VehicleOrderID sel_ord; const Order & new_order; - InsertOrder(VehicleID veh, VehicleOrderID sel_ord, const Order & new_order) - :veh{veh}, sel_ord{sel_ord}, new_order{new_order} {} + InsertOrder(TileIndex location, VehicleID veh, VehicleOrderID sel_ord, const Order & new_order) + :location{location}, veh{veh}, sel_ord{sel_ord}, new_order{new_order} {} ~InsertOrder() override {} bool _post(::CommandCallback * callback) override; @@ -1792,12 +1761,13 @@ public: class OrderRefit: public Command { public: + TileIndex location; VehicleID veh; VehicleOrderID order_number; CargoID cargo; - OrderRefit(VehicleID veh, VehicleOrderID order_number, CargoID cargo) - :veh{veh}, order_number{order_number}, cargo{cargo} {} + OrderRefit(TileIndex location, VehicleID veh, VehicleOrderID order_number, CargoID cargo) + :location{location}, veh{veh}, order_number{order_number}, cargo{cargo} {} ~OrderRefit() override {} bool _post(::CommandCallback * callback) override; @@ -1807,12 +1777,13 @@ public: class CloneOrder: public Command { public: + TileIndex location; CloneOptions action; VehicleID veh_dst; VehicleID veh_src; - CloneOrder(CloneOptions action, VehicleID veh_dst, VehicleID veh_src) - :action{action}, veh_dst{veh_dst}, veh_src{veh_src} {} + CloneOrder(TileIndex location, CloneOptions action, VehicleID veh_dst, VehicleID veh_src) + :location{location}, action{action}, veh_dst{veh_dst}, veh_src{veh_src} {} ~CloneOrder() override {} bool _post(::CommandCallback * callback) override; @@ -1822,12 +1793,13 @@ public: class MoveOrder: public Command { public: + TileIndex location; VehicleID veh; VehicleOrderID moving_order; VehicleOrderID target_order; - MoveOrder(VehicleID veh, VehicleOrderID moving_order, VehicleOrderID target_order) - :veh{veh}, moving_order{moving_order}, target_order{target_order} {} + MoveOrder(TileIndex location, VehicleID veh, VehicleOrderID moving_order, VehicleOrderID target_order) + :location{location}, veh{veh}, moving_order{moving_order}, target_order{target_order} {} ~MoveOrder() override {} bool _post(::CommandCallback * callback) override; @@ -1837,12 +1809,11 @@ public: class ClearOrderBackup: public Command { public: + TileIndex tile; ClientID user_id; - ClearOrderBackup(ClientID user_id) - :user_id{user_id} {} ClearOrderBackup(TileIndex tile, ClientID user_id) - :Command{tile}, user_id{user_id} {} + :tile{tile}, user_id{user_id} {} ~ClearOrderBackup() override {} bool _post(::CommandCallback * callback) override; @@ -1865,14 +1836,13 @@ public: class ChangeBankBalance: public Command { public: + TileIndex tile; Money delta; CompanyID company; ExpensesType expenses_type; - ChangeBankBalance(Money delta, CompanyID company, ExpensesType expenses_type) - :delta{delta}, company{company}, expenses_type{expenses_type} {} ChangeBankBalance(TileIndex tile, Money delta, CompanyID company, ExpensesType expenses_type) - :Command{tile}, delta{delta}, company{company}, expenses_type{expenses_type} {} + :tile{tile}, delta{delta}, company{company}, expenses_type{expenses_type} {} ~ChangeBankBalance() override {} bool _post(::CommandCallback * callback) override; @@ -1980,15 +1950,14 @@ public: class BuildBridge: public Command { public: + TileIndex tile_end; TileIndex tile_start; TransportType transport_type; BridgeType bridge_type; byte road_rail_type; - BuildBridge(TileIndex tile_start, TransportType transport_type, BridgeType bridge_type, byte road_rail_type) - :tile_start{tile_start}, transport_type{transport_type}, bridge_type{bridge_type}, road_rail_type{road_rail_type} {} - BuildBridge(TileIndex tile, TileIndex tile_start, TransportType transport_type, BridgeType bridge_type, byte road_rail_type) - :Command{tile}, tile_start{tile_start}, transport_type{transport_type}, bridge_type{bridge_type}, road_rail_type{road_rail_type} {} + BuildBridge(TileIndex tile_end, TileIndex tile_start, TransportType transport_type, BridgeType bridge_type, byte road_rail_type) + :tile_end{tile_end}, tile_start{tile_start}, transport_type{transport_type}, bridge_type{bridge_type}, road_rail_type{road_rail_type} {} ~BuildBridge() override {} bool _post(::CommandCallback * callback) override; @@ -1998,13 +1967,12 @@ public: class BuildTunnel: public Command { public: + TileIndex start_tile; TransportType transport_type; byte road_rail_type; - BuildTunnel(TransportType transport_type, byte road_rail_type) - :transport_type{transport_type}, road_rail_type{road_rail_type} {} - BuildTunnel(TileIndex tile, TransportType transport_type, byte road_rail_type) - :Command{tile}, transport_type{transport_type}, road_rail_type{road_rail_type} {} + BuildTunnel(TileIndex start_tile, TransportType transport_type, byte road_rail_type) + :start_tile{start_tile}, transport_type{transport_type}, road_rail_type{road_rail_type} {} ~BuildTunnel() override {} bool _post(::CommandCallback * callback) override; diff --git a/src/network/network_command.cpp b/src/network/network_command.cpp index cb6df476ef..5efeae8f04 100644 --- a/src/network/network_command.cpp +++ b/src/network/network_command.cpp @@ -332,7 +332,7 @@ void NetworkExecuteLocalCommandQueue() if (_frame_counter > cp->frame) { /* If we reach here, it means for whatever reason, we've already executed * past the command we need to execute. */ - error("[net] Trying to execute a packet in the past! (frame=%u cmd_frame=%u cmd=%u tile=%u)", (uint)_frame_counter, (uint)cp->frame, (uint)cp->cmd, (uint)cp->tile); + error("[net] Trying to execute a packet in the past! (frame=%u cmd_frame=%u cmd=%u)", (uint)_frame_counter, (uint)cp->frame, (uint)cp->cmd); } /* We can execute this command */ @@ -554,7 +554,7 @@ void UnpackNetworkCommand(const CommandPacket* cp) { citymania::BeforeNetworkCommandExecution(cp); auto args = EndianBufferReader::ToValue::Args>(cp->data); - Debug(misc, 5, "UnpackNetworkCommand cmd={} my={} tile={}", GetCommandName(cp->cmd), cp->my_cmd, cp->tile); + Debug(misc, 5, "UnpackNetworkCommand cmd={} my={}", GetCommandName(cp->cmd), cp->my_cmd); Command::PostFromNet(cp->err_msg, std::get(_callback_tuple), cp->my_cmd, args); citymania::AfterNetworkCommandExecution(cp); } diff --git a/src/order_gui.cpp b/src/order_gui.cpp index d3e224870c..840d6749b1 100644 --- a/src/order_gui.cpp +++ b/src/order_gui.cpp @@ -816,10 +816,10 @@ private: if (this->vehicle->GetNumOrders() <= 1) return; citymania::cmd::SkipToOrder( + this->vehicle->tile, this->vehicle->index, citymania::_fn_mod ? this->OrderGetSel() : ((this->vehicle->cur_implicit_order_index + 1) % this->vehicle->GetNumOrders())) .with_error(citymania::_fn_mod ? STR_ERROR_CAN_T_SKIP_TO_ORDER : STR_ERROR_CAN_T_SKIP_ORDER) - .with_tile(this->vehicle->tile) .no_estimate() .post(); } @@ -1587,33 +1587,28 @@ public: if (feeder_mod != FeederOrderMod::NONE) { if (feeder_mod == FeederOrderMod::LOAD) { - if (citymania::cmd::InsertOrder(this->vehicle->index, 1, cmd) - .with_tile(this->vehicle->tile) + if (citymania::cmd::InsertOrder(this->vehicle->tile, this->vehicle->index, 1, cmd) .with_error(STR_ERROR_CAN_T_INSERT_NEW_ORDER) .no_estimate() .post()) { - citymania::cmd::DeleteOrder(this->vehicle->index, 0) - .with_tile(this->vehicle->tile) + citymania::cmd::DeleteOrder(this->vehicle->tile, this->vehicle->index, 0) .with_error(STR_ERROR_CAN_T_DELETE_THIS_ORDER) .no_estimate() .post(); } } else if (feeder_mod == FeederOrderMod::UNLOAD) { // still flushes the whole order table - if (citymania::cmd::InsertOrder(this->vehicle->index, this->vehicle->GetNumOrders(), cmd) - .with_tile(this->vehicle->tile) + if (citymania::cmd::InsertOrder(this->vehicle->tile, this->vehicle->index, this->vehicle->GetNumOrders(), cmd) .with_error(STR_ERROR_CAN_T_INSERT_NEW_ORDER) .no_estimate() .post()) { - citymania::cmd::DeleteOrder(this->vehicle->index, this->vehicle->GetNumOrders() + (int)_networking - 2) - .with_tile(this->vehicle->tile) + citymania::cmd::DeleteOrder(this->vehicle->tile, this->vehicle->index, this->vehicle->GetNumOrders() + (int)_networking - 2) .with_error(STR_ERROR_CAN_T_DELETE_THIS_ORDER) .no_estimate() .post(); } } - } else if (citymania::cmd::InsertOrder(this->vehicle->index, this->OrderGetSel(), cmd) - .with_tile(this->vehicle->tile) + } else if (citymania::cmd::InsertOrder(this->vehicle->tile, this->vehicle->index, this->OrderGetSel(), cmd) .with_error(STR_ERROR_CAN_T_INSERT_NEW_ORDER) .no_estimate() .post()) { diff --git a/src/toolbar_gui.cpp b/src/toolbar_gui.cpp index d0ca4380a6..8a12c53bd6 100644 --- a/src/toolbar_gui.cpp +++ b/src/toolbar_gui.cpp @@ -2231,8 +2231,7 @@ struct MainToolbarWindow : Window { break; case CM_CBF_BUILD_HQ: - if(citymania::cmd::BuildObject(OBJECT_HQ, 0) - .with_tile(tile) + if(citymania::cmd::BuildObject(tile, OBJECT_HQ, 0) .with_error(STR_ERROR_CAN_T_BUILD_COMPANY_HEADQUARTERS) .post()) { ResetObjectToPlace(); diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp index 112d93f50a..d988c23cea 100644 --- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -919,8 +919,7 @@ static void DoRegularFunding(Town *t) if (UINT32_MAX - t->last_funding + _tick_counter < TOWN_GROWTH_TICKS) return; } else if (_tick_counter - t->last_funding < TOWN_GROWTH_TICKS) return; - citymania::cmd::DoTownAction(t->index, HK_FUND) - .with_tile(t->xy) + citymania::cmd::DoTownAction(t->xy, t->index, HK_FUND) .no_estimate() .as_company(_local_company) .post(); @@ -957,8 +956,7 @@ static void DoRegularAdvertising(Town *t) { t->last_advertisement = _tick_counter; auto prev_rating = t->ad_ref_goods_entry->rating; - citymania::cmd::DoTownAction(t->index, HK_LADVERT) - .with_tile(t->xy) + citymania::cmd::DoTownAction(t->xy, t->index, HK_LADVERT) .no_estimate() .as_company(_local_company) .with_callback([=] (bool res) -> bool { diff --git a/src/town_gui.cpp b/src/town_gui.cpp index 7fe270b4f5..693c3c7f28 100644 --- a/src/town_gui.cpp +++ b/src/town_gui.cpp @@ -61,8 +61,7 @@ static void DrawExtraTownInfo (Rect &r, Town *town, uint line, bool show_house_s bool TownExecuteAction(const Town *town, uint action){ if(!(action == HK_STATUE && HasBit(town->statues, _current_company))){ //don't built statue when there is one - return citymania::cmd::DoTownAction(town->index, action) - .with_tile(town->xy) + return citymania::cmd::DoTownAction(town->xy, town->index, action) .with_error(STR_ERROR_CAN_T_DO_THIS) .post(); }