diff --git a/gen_commands.py b/gen_commands.py index b737cd67d5..4ac35fe12e 100644 --- a/gen_commands.py +++ b/gen_commands.py @@ -1,14 +1,16 @@ import glob +import json import re from pathlib import Path from pprint import pprint RX_COMMAND = re.compile(r'(?PCommandCost|std::tuple]*>) (?PCmd\w*)\((?P[^)]*)\);') -RX_DEF_TRAIT = re.compile(r'DEF_CMD_TRAIT\((?P\w+),\s+(?P\w+),\s+[^,]*,\s+(?P\w+)\)') +RX_DEF_TRAIT = re.compile(r'DEF_CMD_TRAIT\((?P\w+),\s+(?P\w+),\s+(?P[^,]*),\s+(?P\w+)\)') RX_ARG = re.compile(r'(?P(:?const |)[\w:]* &?)(?P\w*)') RX_CALLBACK = re.compile(r'void\s+(?PCc\w+)\(Commands') RX_CALLBACK_REF = re.compile(r'CommandCallback\s+(?PCc\w+);') RX_CAMEL_TO_SNAKE = re.compile(r'(?axis == AXIS_X) return CommandArea(this->tile, this->plat_len, this->numtracks);\n' + 'return CommandArea(this->tile, this->numtracks, this->plat_len);\n' + ), + ('CMD_BUILD_AIRPORT',): ( + 'const AirportSpec *as = AirportSpec::Get(this->airport_type);\n' + 'if (!as->IsAvailable()) return CommandArea(this->tile);\n' + 'return CommandArea(this->tile, as->size_x, as->size_y);\n' + ), + ('CMD_BUILD_ROAD_STOP',): + 'return CommandArea(this->tile, this->width, this->length);\n', + #TODO diagonal areas + ( + 'CMD_PLANT_TREE', + 'CMD_BUILD_RAILROAD_TRACK', + 'CMD_REMOVE_RAILROAD_TRACK', + 'CMD_BUILD_LONG_ROAD', + 'CMD_REMOVE_LONG_ROAD', + 'CMD_CLEAR_AREA', + 'CMD_BUILD_CANAL', + 'CMD_LEVEL_LAND', + 'CMD_BUILD_BRIDGE', + ): 'return CommandArea(this->start_tile, this->tile);\n', + ( + 'CMD_BUILD_BRIDGE', + ): 'return CommandArea(this->tile_start, this->tile);\n', + ( + 'CMD_BUILD_SINGLE_RAIL', + 'CMD_BUILD_TRAIN_DEPOT', + 'CMD_BUILD_BUOY', + 'CMD_BUILD_ROAD', + 'CMD_BUILD_ROAD_DEPOT', + 'CMD_PLACE_SIGN', + 'CMD_LANDSCAPE_CLEAR', + 'CMD_TERRAFORM_LAND', + 'CMD_FOUND_TOWN', # TODO + 'CMD_BUILD_DOCK', # TODO + 'CMD_BUILD_SHIP_DEPOT', # TODO + 'CMD_BUILD_LOCK', # TODO + 'CMD_BUILD_OBJECT', # TODO + 'CMD_BUILD_INDUSTRY', # TODO + 'CMD_BUILD_TUNNEL', # TODO find other end + ): 'return CommandArea(this->tile);\n' +} + +DEFAULT_AREA_CODE = 'return CommandArea();\n' def parse_commands(): res = [] includes = [] callbacks = [] + + command_ids = {} + cid = 0 + for l in open(BASE_DIR / 'src' / 'command_type.h'): + cl = RX_CMD_CONSTANT.findall(l) + if not cl: + continue + cmd = cl[0] + if cmd == 'CMD_END': + break + command_ids[cmd] = cid + cid += 1 + for f in glob.glob(str(BASE_DIR / 'src' / '*_cmd.h')): + # for f in glob.glob(str(BASE_DIR / 'src' / 'group_cmd.h')): includes.append(Path(f).name) data = open(f).read() traits = {} - for constant, name, category in RX_DEF_TRAIT.findall(data): - traits[name] = constant, category + for constant, name, flags, category in RX_DEF_TRAIT.findall(data): + traits[name] = constant, flags, category callbacks.extend(RX_CALLBACK.findall(data)) callbacks.extend(RX_CALLBACK_REF.findall(data)) for returns, name, args_str in RX_COMMAND.findall(data): @@ -43,24 +111,51 @@ def parse_commands(): print(f'Not a command: {name}') continue print(f, name, end=' ', flush=True) - constant, category = trait + constant, flags, category = trait + cid = command_ids[constant] if returns.startswith('std::tuple'): - ret_type = returns[24: -1] + result_type = returns[24: -1] + if result_type in GLOBAL_TYPES: + result_type = '::' + result_type else: - ret_type = None + 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:] - print(constant, category, args) + for i, (at, an) in enumerate(args): + at = at.strip() + if at in GLOBAL_TYPES: + at = '::' + at + args[i] = (at, an) + print(cid, constant, category, args) + callback_args = 'CommandCost' if result_type is None else f'CommandCost, {result_type}' + callback_type = f'std::function' + area_code = DEFAULT_AREA_CODE + for cl, cc in AREA_CODE.items(): + if constant in cl: + area_code = cc + + default_run_as = 'INVALID_COMPANY' + if 'CMD_DEITY' in flags: + default_run_as = 'OWNER_DEITY' + if 'CMD_SERVER' in flags or 'CMD_SPECTATOR' in flags: + default_run_as = 'COMPANY_SPECTATOR' # same as INVALID though + res.append({ 'name': name[3:], + 'id': cid, 'constant': constant, 'category': category, + 'flags': flags, + 'default_run_as': default_run_as, 'args': args, 'first_tile_arg': first_tile_arg, - 'returns': ret_type, + 'returns': returns, + 'result_type': result_type, + 'callback_type': callback_type, + 'area_code': area_code, }) return res, includes, callbacks @@ -128,6 +223,11 @@ inline constexpr auto MakeDispatchTable() noexcept def run(): commands, includes, callbacks = parse_commands() + json.dump({ + 'commands': commands, + 'includes': includes, + 'callbacks': callbacks, + }, open('commands.json', 'w')) with open(OUTPUT.with_suffix('.hpp'), 'w') as f: f.write( '// This file is generated by gen_commands.py, do not edit\n\n' @@ -144,14 +244,14 @@ def run(): ) for cmd in commands: name = cmd['name'] - args_list = ', '.join(f'{at}{an}' for at, an in cmd['args']) + args_list = ', '.join(f'{at} {an}' for at, an in cmd['args']) args_init = ', '.join(f'{an}{{{an}}}' for _, an in cmd['args']) f.write( f'class {name}: public Command {{\n' f'public:\n' ) for at, an in cmd['args']: - f.write(f' {at}{an};\n') + f.write(f' {at} {an};\n') f.write(f'\n') if args_init: f.write( @@ -220,7 +320,7 @@ def run(): else: test_args_list = f'this->tile' - cost_getter = '' if cmd['returns'] is None else 'std::get<0>' + 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: sep_args_list = ', ' + args_list diff --git a/src/citymania/cm_command_log.cpp b/src/citymania/cm_command_log.cpp index f4c0e79a25..c1d65fa894 100644 --- a/src/citymania/cm_command_log.cpp +++ b/src/citymania/cm_command_log.cpp @@ -133,7 +133,6 @@ void load_replay_commands(const std::string &filename, std::function(); +static constexpr auto _CreateStoryPage_dispatch = MakeDispatchTable(); bool CreateStoryPage::_post(::CommandCallback *callback) { return _CreateStoryPage_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->company, this->text); } @@ -115,7 +115,7 @@ CommandCost CreateStoryPage::_do(DoCommandFlag flags) { } 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); } @@ -124,7 +124,7 @@ CommandCost CreateStoryPageElement::_do(DoCommandFlag flags) { } 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); } @@ -133,7 +133,7 @@ CommandCost UpdateStoryPageElement::_do(DoCommandFlag flags) { } Commands SetStoryPageTitle::get_command() { return CMD_SET_STORY_PAGE_TITLE; } -static constexpr auto _SetStoryPageTitle_dispatch = MakeDispatchTable(); +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); } @@ -142,7 +142,7 @@ CommandCost SetStoryPageTitle::_do(DoCommandFlag flags) { } Commands SetStoryPageDate::get_command() { return CMD_SET_STORY_PAGE_DATE; } -static constexpr auto _SetStoryPageDate_dispatch = MakeDispatchTable(); +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); } @@ -151,7 +151,7 @@ CommandCost SetStoryPageDate::_do(DoCommandFlag flags) { } Commands ShowStoryPage::get_command() { return CMD_SHOW_STORY_PAGE; } -static constexpr auto _ShowStoryPage_dispatch = MakeDispatchTable(); +static constexpr auto _ShowStoryPage_dispatch = MakeDispatchTable(); bool ShowStoryPage::_post(::CommandCallback *callback) { return _ShowStoryPage_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->page_id); } @@ -160,7 +160,7 @@ CommandCost ShowStoryPage::_do(DoCommandFlag flags) { } Commands RemoveStoryPage::get_command() { return CMD_REMOVE_STORY_PAGE; } -static constexpr auto _RemoveStoryPage_dispatch = MakeDispatchTable(); +static constexpr auto _RemoveStoryPage_dispatch = MakeDispatchTable(); bool RemoveStoryPage::_post(::CommandCallback *callback) { return _RemoveStoryPage_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->page_id); } @@ -169,7 +169,7 @@ CommandCost RemoveStoryPage::_do(DoCommandFlag flags) { } Commands RemoveStoryPageElement::get_command() { return CMD_REMOVE_STORY_PAGE_ELEMENT; } -static constexpr auto _RemoveStoryPageElement_dispatch = MakeDispatchTable(); +static constexpr auto _RemoveStoryPageElement_dispatch = MakeDispatchTable(); bool RemoveStoryPageElement::_post(::CommandCallback *callback) { return _RemoveStoryPageElement_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->page_element_id); } @@ -178,7 +178,7 @@ CommandCost RemoveStoryPageElement::_do(DoCommandFlag flags) { } 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); } @@ -187,7 +187,7 @@ CommandCost StoryPageButton::_do(DoCommandFlag flags) { } 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); } @@ -196,7 +196,7 @@ CommandCost BuildRailWaypoint::_do(DoCommandFlag flags) { } 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); } @@ -214,7 +214,7 @@ CommandCost BuildBuoy::_do(DoCommandFlag flags) { } Commands RenameWaypoint::get_command() { return CMD_RENAME_WAYPOINT; } -static constexpr auto _RenameWaypoint_dispatch = MakeDispatchTable(); +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); } @@ -223,7 +223,7 @@ CommandCost RenameWaypoint::_do(DoCommandFlag flags) { } 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); } @@ -232,7 +232,7 @@ CommandCost BuildAirport::_do(DoCommandFlag flags) { } 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); } @@ -241,7 +241,7 @@ CommandCost BuildDock::_do(DoCommandFlag flags) { } 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); } @@ -250,7 +250,7 @@ CommandCost BuildRailStation::_do(DoCommandFlag flags) { } 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); } @@ -259,7 +259,7 @@ CommandCost RemoveFromRailStation::_do(DoCommandFlag flags) { } 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); } @@ -268,7 +268,7 @@ CommandCost BuildRoadStop::_do(DoCommandFlag flags) { } 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); } @@ -277,7 +277,7 @@ CommandCost RemoveRoadStop::_do(DoCommandFlag flags) { } Commands RenameStation::get_command() { return CMD_RENAME_STATION; } -static constexpr auto _RenameStation_dispatch = MakeDispatchTable(); +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); } @@ -286,7 +286,7 @@ CommandCost RenameStation::_do(DoCommandFlag flags) { } Commands OpenCloseAirport::get_command() { return CMD_OPEN_CLOSE_AIRPORT; } -static constexpr auto _OpenCloseAirport_dispatch = MakeDispatchTable(); +static constexpr auto _OpenCloseAirport_dispatch = MakeDispatchTable(); bool OpenCloseAirport::_post(::CommandCallback *callback) { return _OpenCloseAirport_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->station_id); } @@ -295,7 +295,7 @@ CommandCost OpenCloseAirport::_do(DoCommandFlag flags) { } Commands CreateGoal::get_command() { return CMD_CREATE_GOAL; } -static constexpr auto _CreateGoal_dispatch = MakeDispatchTable(); +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); } @@ -304,7 +304,7 @@ CommandCost CreateGoal::_do(DoCommandFlag flags) { } Commands RemoveGoal::get_command() { return CMD_REMOVE_GOAL; } -static constexpr auto _RemoveGoal_dispatch = MakeDispatchTable(); +static constexpr auto _RemoveGoal_dispatch = MakeDispatchTable(); bool RemoveGoal::_post(::CommandCallback *callback) { return _RemoveGoal_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->goal); } @@ -313,7 +313,7 @@ CommandCost RemoveGoal::_do(DoCommandFlag flags) { } Commands SetGoalText::get_command() { return CMD_SET_GOAL_TEXT; } -static constexpr auto _SetGoalText_dispatch = MakeDispatchTable(); +static constexpr auto _SetGoalText_dispatch = MakeDispatchTable(); bool SetGoalText::_post(::CommandCallback *callback) { return _SetGoalText_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->goal, this->text); } @@ -322,7 +322,7 @@ CommandCost SetGoalText::_do(DoCommandFlag flags) { } Commands SetGoalProgress::get_command() { return CMD_SET_GOAL_PROGRESS; } -static constexpr auto _SetGoalProgress_dispatch = MakeDispatchTable(); +static constexpr auto _SetGoalProgress_dispatch = MakeDispatchTable(); bool SetGoalProgress::_post(::CommandCallback *callback) { return _SetGoalProgress_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->goal, this->text); } @@ -331,7 +331,7 @@ CommandCost SetGoalProgress::_do(DoCommandFlag flags) { } Commands SetGoalCompleted::get_command() { return CMD_SET_GOAL_COMPLETED; } -static constexpr auto _SetGoalCompleted_dispatch = MakeDispatchTable(); +static constexpr auto _SetGoalCompleted_dispatch = MakeDispatchTable(); bool SetGoalCompleted::_post(::CommandCallback *callback) { return _SetGoalCompleted_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->goal, this->completed); } @@ -340,7 +340,7 @@ CommandCost SetGoalCompleted::_do(DoCommandFlag flags) { } Commands GoalQuestion::get_command() { return CMD_GOAL_QUESTION; } -static constexpr auto _GoalQuestion_dispatch = MakeDispatchTable(); +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); } @@ -349,7 +349,7 @@ CommandCost GoalQuestion::_do(DoCommandFlag flags) { } Commands GoalQuestionAnswer::get_command() { return CMD_GOAL_QUESTION_ANSWER; } -static constexpr auto _GoalQuestionAnswer_dispatch = MakeDispatchTable(); +static constexpr auto _GoalQuestionAnswer_dispatch = MakeDispatchTable(); bool GoalQuestionAnswer::_post(::CommandCallback *callback) { return _GoalQuestionAnswer_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->uniqueid, this->button); } @@ -358,7 +358,7 @@ CommandCost GoalQuestionAnswer::_do(DoCommandFlag flags) { } Commands ChangeSetting::get_command() { return CMD_CHANGE_SETTING; } -static constexpr auto _ChangeSetting_dispatch = MakeDispatchTable(); +static constexpr auto _ChangeSetting_dispatch = MakeDispatchTable(); bool ChangeSetting::_post(::CommandCallback *callback) { return _ChangeSetting_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->name, this->value); } @@ -367,7 +367,7 @@ CommandCost ChangeSetting::_do(DoCommandFlag flags) { } Commands ChangeCompanySetting::get_command() { return CMD_CHANGE_COMPANY_SETTING; } -static constexpr auto _ChangeCompanySetting_dispatch = MakeDispatchTable(); +static constexpr auto _ChangeCompanySetting_dispatch = MakeDispatchTable(); bool ChangeCompanySetting::_post(::CommandCallback *callback) { return _ChangeCompanySetting_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->name, this->value); } @@ -376,7 +376,7 @@ CommandCost ChangeCompanySetting::_do(DoCommandFlag flags) { } Commands CustomNewsItem::get_command() { return CMD_CUSTOM_NEWS_ITEM; } -static constexpr auto _CustomNewsItem_dispatch = MakeDispatchTable(); +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); } @@ -385,7 +385,7 @@ CommandCost CustomNewsItem::_do(DoCommandFlag flags) { } 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); } @@ -394,7 +394,7 @@ CommandCost BuildObject::_do(DoCommandFlag flags) { } 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); } @@ -403,7 +403,7 @@ CommandCost BuildObjectArea::_do(DoCommandFlag flags) { } 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); } @@ -412,7 +412,7 @@ CommandCost BuildShipDepot::_do(DoCommandFlag flags) { } 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); } @@ -430,7 +430,7 @@ CommandCost BuildLock::_do(DoCommandFlag flags) { } 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); } @@ -439,7 +439,7 @@ CommandCost BuildLongRoad::_do(DoCommandFlag flags) { } 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); } @@ -448,7 +448,7 @@ CommandCost RemoveLongRoad::_do(DoCommandFlag flags) { } 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); } @@ -457,7 +457,7 @@ CommandCost BuildRoad::_do(DoCommandFlag flags) { } 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); } @@ -466,7 +466,7 @@ CommandCost BuildRoadDepot::_do(DoCommandFlag flags) { } 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); } @@ -475,7 +475,7 @@ CommandCost ConvertRoad::_do(DoCommandFlag flags) { } Commands BuyShareInCompany::get_command() { return CMD_BUY_SHARE_IN_COMPANY; } -static constexpr auto _BuyShareInCompany_dispatch = MakeDispatchTable(); +static constexpr auto _BuyShareInCompany_dispatch = MakeDispatchTable(); bool BuyShareInCompany::_post(::CommandCallback *callback) { return _BuyShareInCompany_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->target_company); } @@ -484,7 +484,7 @@ CommandCost BuyShareInCompany::_do(DoCommandFlag flags) { } Commands SellShareInCompany::get_command() { return CMD_SELL_SHARE_IN_COMPANY; } -static constexpr auto _SellShareInCompany_dispatch = MakeDispatchTable(); +static constexpr auto _SellShareInCompany_dispatch = MakeDispatchTable(); bool SellShareInCompany::_post(::CommandCallback *callback) { return _SellShareInCompany_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->target_company); } @@ -493,7 +493,7 @@ CommandCost SellShareInCompany::_do(DoCommandFlag flags) { } Commands BuyCompany::get_command() { return CMD_BUY_COMPANY; } -static constexpr auto _BuyCompany_dispatch = MakeDispatchTable(); +static constexpr auto _BuyCompany_dispatch = MakeDispatchTable(); bool BuyCompany::_post(::CommandCallback *callback) { return _BuyCompany_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->target_company); } @@ -511,7 +511,7 @@ CommandCost LandscapeClear::_do(DoCommandFlag flags) { } 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); } @@ -520,7 +520,7 @@ CommandCost ClearArea::_do(DoCommandFlag flags) { } 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); } @@ -529,7 +529,7 @@ CommandCost MoveRailVehicle::_do(DoCommandFlag flags) { } 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); } @@ -538,7 +538,7 @@ CommandCost ForceTrainProceed::_do(DoCommandFlag flags) { } 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); } @@ -547,7 +547,7 @@ CommandCost ReverseTrainDirection::_do(DoCommandFlag flags) { } Commands CreateSubsidy::get_command() { return CMD_CREATE_SUBSIDY; } -static constexpr auto _CreateSubsidy_dispatch = MakeDispatchTable(); +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); } @@ -556,7 +556,7 @@ CommandCost CreateSubsidy::_do(DoCommandFlag flags) { } 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); } @@ -565,7 +565,7 @@ CommandCost ScrollViewport::_do(DoCommandFlag flags) { } Commands ChangeTimetable::get_command() { return CMD_CHANGE_TIMETABLE; } -static constexpr auto _ChangeTimetable_dispatch = MakeDispatchTable(); +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); } @@ -574,7 +574,7 @@ CommandCost ChangeTimetable::_do(DoCommandFlag flags) { } Commands BulkChangeTimetable::get_command() { return CMD_BULK_CHANGE_TIMETABLE; } -static constexpr auto _BulkChangeTimetable_dispatch = MakeDispatchTable(); +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); } @@ -583,7 +583,7 @@ CommandCost BulkChangeTimetable::_do(DoCommandFlag flags) { } Commands SetVehicleOnTime::get_command() { return CMD_SET_VEHICLE_ON_TIME; } -static constexpr auto _SetVehicleOnTime_dispatch = MakeDispatchTable(); +static constexpr auto _SetVehicleOnTime_dispatch = MakeDispatchTable(); bool SetVehicleOnTime::_post(::CommandCallback *callback) { return _SetVehicleOnTime_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->veh); } @@ -592,7 +592,7 @@ CommandCost SetVehicleOnTime::_do(DoCommandFlag flags) { } Commands AutofillTimetable::get_command() { return CMD_AUTOFILL_TIMETABLE; } -static constexpr auto _AutofillTimetable_dispatch = MakeDispatchTable(); +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); } @@ -601,7 +601,7 @@ CommandCost AutofillTimetable::_do(DoCommandFlag flags) { } Commands SetTimetableStart::get_command() { return CMD_SET_TIMETABLE_START; } -static constexpr auto _SetTimetableStart_dispatch = MakeDispatchTable(); +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); } @@ -610,7 +610,7 @@ CommandCost SetTimetableStart::_do(DoCommandFlag flags) { } 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); } @@ -628,7 +628,7 @@ CommandCost CreateLeagueTable::_do(DoCommandFlag flags) { } Commands CreateLeagueTableElement::get_command() { return CMD_CREATE_LEAGUE_TABLE_ELEMENT; } -static constexpr auto _CreateLeagueTableElement_dispatch = MakeDispatchTable(); +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); } @@ -637,7 +637,7 @@ CommandCost CreateLeagueTableElement::_do(DoCommandFlag flags) { } Commands UpdateLeagueTableElementData::get_command() { return CMD_UPDATE_LEAGUE_TABLE_ELEMENT_DATA; } -static constexpr auto _UpdateLeagueTableElementData_dispatch = MakeDispatchTable(); +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); } @@ -646,7 +646,7 @@ CommandCost UpdateLeagueTableElementData::_do(DoCommandFlag flags) { } Commands UpdateLeagueTableElementScore::get_command() { return CMD_UPDATE_LEAGUE_TABLE_ELEMENT_SCORE; } -static constexpr auto _UpdateLeagueTableElementScore_dispatch = MakeDispatchTable(); +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); } @@ -655,7 +655,7 @@ CommandCost UpdateLeagueTableElementScore::_do(DoCommandFlag flags) { } Commands RemoveLeagueTableElement::get_command() { return CMD_REMOVE_LEAGUE_TABLE_ELEMENT; } -static constexpr auto _RemoveLeagueTableElement_dispatch = MakeDispatchTable(); +static constexpr auto _RemoveLeagueTableElement_dispatch = MakeDispatchTable(); bool RemoveLeagueTableElement::_post(::CommandCallback *callback) { return _RemoveLeagueTableElement_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->element); } @@ -673,7 +673,7 @@ CommandCost PlaceSign::_do(DoCommandFlag flags) { } Commands RenameSign::get_command() { return CMD_RENAME_SIGN; } -static constexpr auto _RenameSign_dispatch = MakeDispatchTable(); +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); } @@ -682,7 +682,7 @@ CommandCost RenameSign::_do(DoCommandFlag flags) { } 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); } @@ -691,7 +691,7 @@ CommandCost BuildVehicle::_do(DoCommandFlag flags) { } 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); } @@ -700,7 +700,7 @@ CommandCost SellVehicle::_do(DoCommandFlag flags) { } 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); } @@ -709,7 +709,7 @@ CommandCost RefitVehicle::_do(DoCommandFlag flags) { } Commands SendVehicleToDepot::get_command() { return CMD_SEND_VEHICLE_TO_DEPOT; } -static constexpr auto _SendVehicleToDepot_dispatch = MakeDispatchTable(); +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); } @@ -718,7 +718,7 @@ CommandCost SendVehicleToDepot::_do(DoCommandFlag flags) { } Commands ChangeServiceInt::get_command() { return CMD_CHANGE_SERVICE_INT; } -static constexpr auto _ChangeServiceInt_dispatch = MakeDispatchTable(); +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); } @@ -727,7 +727,7 @@ CommandCost ChangeServiceInt::_do(DoCommandFlag flags) { } Commands RenameVehicle::get_command() { return CMD_RENAME_VEHICLE; } -static constexpr auto _RenameVehicle_dispatch = MakeDispatchTable(); +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); } @@ -736,7 +736,7 @@ CommandCost RenameVehicle::_do(DoCommandFlag flags) { } 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); } @@ -745,7 +745,7 @@ CommandCost CloneVehicle::_do(DoCommandFlag flags) { } 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); } @@ -754,7 +754,7 @@ CommandCost StartStopVehicle::_do(DoCommandFlag flags) { } 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); } @@ -763,7 +763,7 @@ CommandCost MassStartStopVehicle::_do(DoCommandFlag flags) { } 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); } @@ -772,7 +772,7 @@ CommandCost DepotSellAllVehicles::_do(DoCommandFlag flags) { } 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); } @@ -781,7 +781,7 @@ CommandCost DepotMassAutoReplace::_do(DoCommandFlag flags) { } 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); } @@ -790,7 +790,7 @@ CommandCost TerraformLand::_do(DoCommandFlag flags) { } 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); } @@ -799,7 +799,7 @@ CommandCost LevelLand::_do(DoCommandFlag flags) { } Commands RenameDepot::get_command() { return CMD_RENAME_DEPOT; } -static constexpr auto _RenameDepot_dispatch = MakeDispatchTable(); +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); } @@ -808,7 +808,7 @@ CommandCost RenameDepot::_do(DoCommandFlag flags) { } 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); } @@ -817,7 +817,7 @@ CommandCost BuildRailroadTrack::_do(DoCommandFlag flags) { } 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); } @@ -826,7 +826,7 @@ CommandCost RemoveRailroadTrack::_do(DoCommandFlag flags) { } 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); } @@ -835,7 +835,7 @@ CommandCost BuildSingleRail::_do(DoCommandFlag flags) { } 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); } @@ -844,7 +844,7 @@ CommandCost RemoveSingleRail::_do(DoCommandFlag flags) { } 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); } @@ -853,7 +853,7 @@ CommandCost BuildTrainDepot::_do(DoCommandFlag flags) { } 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); } @@ -862,7 +862,7 @@ CommandCost BuildSingleSignal::_do(DoCommandFlag flags) { } 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); } @@ -871,7 +871,7 @@ CommandCost RemoveSingleSignal::_do(DoCommandFlag flags) { } 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); } @@ -880,7 +880,7 @@ CommandCost ConvertRail::_do(DoCommandFlag flags) { } 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); } @@ -889,7 +889,7 @@ CommandCost BuildSignalTrack::_do(DoCommandFlag flags) { } 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); } @@ -898,7 +898,7 @@ CommandCost RemoveSignalTrack::_do(DoCommandFlag flags) { } Commands CompanyCtrl::get_command() { return CMD_COMPANY_CTRL; } -static constexpr auto _CompanyCtrl_dispatch = MakeDispatchTable(); +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); } @@ -907,7 +907,7 @@ CommandCost CompanyCtrl::_do(DoCommandFlag flags) { } Commands GiveMoney::get_command() { return CMD_GIVE_MONEY; } -static constexpr auto _GiveMoney_dispatch = MakeDispatchTable(); +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); } @@ -934,7 +934,7 @@ CommandCost RenamePresident::_do(DoCommandFlag flags) { } Commands SetCompanyManagerFace::get_command() { return CMD_SET_COMPANY_MANAGER_FACE; } -static constexpr auto _SetCompanyManagerFace_dispatch = MakeDispatchTable(); +static constexpr auto _SetCompanyManagerFace_dispatch = MakeDispatchTable(); bool SetCompanyManagerFace::_post(::CommandCallback *callback) { return _SetCompanyManagerFace_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->cmf); } @@ -943,7 +943,7 @@ CommandCost SetCompanyManagerFace::_do(DoCommandFlag flags) { } Commands SetCompanyColour::get_command() { return CMD_SET_COMPANY_COLOUR; } -static constexpr auto _SetCompanyColour_dispatch = MakeDispatchTable(); +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); } @@ -952,7 +952,7 @@ CommandCost SetCompanyColour::_do(DoCommandFlag flags) { } Commands AutoreplaceVehicle::get_command() { return CMD_AUTOREPLACE_VEHICLE; } -static constexpr auto _AutoreplaceVehicle_dispatch = MakeDispatchTable(); +static constexpr auto _AutoreplaceVehicle_dispatch = MakeDispatchTable(); bool AutoreplaceVehicle::_post(::CommandCallback *callback) { return _AutoreplaceVehicle_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->veh_id); } @@ -961,7 +961,7 @@ CommandCost AutoreplaceVehicle::_do(DoCommandFlag flags) { } Commands SetAutoReplace::get_command() { return CMD_SET_AUTOREPLACE; } -static constexpr auto _SetAutoReplace_dispatch = MakeDispatchTable(); +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); } @@ -970,7 +970,7 @@ CommandCost SetAutoReplace::_do(DoCommandFlag flags) { } 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); } @@ -979,7 +979,7 @@ CommandCost FoundTown::_do(DoCommandFlag flags) { } Commands RenameTown::get_command() { return CMD_RENAME_TOWN; } -static constexpr auto _RenameTown_dispatch = MakeDispatchTable(); +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); } @@ -988,7 +988,7 @@ CommandCost RenameTown::_do(DoCommandFlag flags) { } 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); } @@ -997,7 +997,7 @@ CommandCost DoTownAction::_do(DoCommandFlag flags) { } Commands TownGrowthRate::get_command() { return CMD_TOWN_GROWTH_RATE; } -static constexpr auto _TownGrowthRate_dispatch = MakeDispatchTable(); +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); } @@ -1006,7 +1006,7 @@ CommandCost TownGrowthRate::_do(DoCommandFlag flags) { } Commands TownRating::get_command() { return CMD_TOWN_RATING; } -static constexpr auto _TownRating_dispatch = MakeDispatchTable(); +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); } @@ -1015,7 +1015,7 @@ CommandCost TownRating::_do(DoCommandFlag flags) { } Commands TownCargoGoal::get_command() { return CMD_TOWN_CARGO_GOAL; } -static constexpr auto _TownCargoGoal_dispatch = MakeDispatchTable(); +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); } @@ -1024,7 +1024,7 @@ CommandCost TownCargoGoal::_do(DoCommandFlag flags) { } Commands TownSetText::get_command() { return CMD_TOWN_SET_TEXT; } -static constexpr auto _TownSetText_dispatch = MakeDispatchTable(); +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); } @@ -1033,7 +1033,7 @@ CommandCost TownSetText::_do(DoCommandFlag flags) { } Commands ExpandTown::get_command() { return CMD_EXPAND_TOWN; } -static constexpr auto _ExpandTown_dispatch = MakeDispatchTable(); +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); } @@ -1042,7 +1042,7 @@ CommandCost ExpandTown::_do(DoCommandFlag flags) { } Commands DeleteTown::get_command() { return CMD_DELETE_TOWN; } -static constexpr auto _DeleteTown_dispatch = MakeDispatchTable(); +static constexpr auto _DeleteTown_dispatch = MakeDispatchTable(); bool DeleteTown::_post(::CommandCallback *callback) { return _DeleteTown_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->town_id); } @@ -1051,7 +1051,7 @@ CommandCost DeleteTown::_do(DoCommandFlag flags) { } 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); } @@ -1060,7 +1060,7 @@ CommandCost TurnRoadVeh::_do(DoCommandFlag flags) { } 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); } @@ -1069,7 +1069,7 @@ CommandCost BuildIndustry::_do(DoCommandFlag flags) { } Commands IndustryCtrl::get_command() { return CMD_INDUSTRY_CTRL; } -static constexpr auto _IndustryCtrl_dispatch = MakeDispatchTable(); +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); } @@ -1078,7 +1078,7 @@ CommandCost IndustryCtrl::_do(DoCommandFlag flags) { } 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); } @@ -1087,7 +1087,7 @@ CommandCost ModifyOrder::_do(DoCommandFlag flags) { } 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); } @@ -1096,7 +1096,7 @@ CommandCost SkipToOrder::_do(DoCommandFlag flags) { } 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); } @@ -1105,7 +1105,7 @@ CommandCost DeleteOrder::_do(DoCommandFlag flags) { } 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); } @@ -1114,7 +1114,7 @@ CommandCost InsertOrder::_do(DoCommandFlag flags) { } 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); } @@ -1123,7 +1123,7 @@ CommandCost OrderRefit::_do(DoCommandFlag flags) { } 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); } @@ -1132,7 +1132,7 @@ CommandCost CloneOrder::_do(DoCommandFlag flags) { } 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); } @@ -1141,7 +1141,7 @@ CommandCost MoveOrder::_do(DoCommandFlag flags) { } 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); } @@ -1150,7 +1150,7 @@ CommandCost ClearOrderBackup::_do(DoCommandFlag flags) { } Commands MoneyCheat::get_command() { return CMD_MONEY_CHEAT; } -static constexpr auto _MoneyCheat_dispatch = MakeDispatchTable(); +static constexpr auto _MoneyCheat_dispatch = MakeDispatchTable(); bool MoneyCheat::_post(::CommandCallback *callback) { return _MoneyCheat_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->amount); } @@ -1159,7 +1159,7 @@ CommandCost MoneyCheat::_do(DoCommandFlag flags) { } 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); } @@ -1168,7 +1168,7 @@ CommandCost ChangeBankBalance::_do(DoCommandFlag flags) { } Commands IncreaseLoan::get_command() { return CMD_INCREASE_LOAN; } -static constexpr auto _IncreaseLoan_dispatch = MakeDispatchTable(); +static constexpr auto _IncreaseLoan_dispatch = MakeDispatchTable(); bool IncreaseLoan::_post(::CommandCallback *callback) { return _IncreaseLoan_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->cmd, this->amount); } @@ -1177,7 +1177,7 @@ CommandCost IncreaseLoan::_do(DoCommandFlag flags) { } Commands DecreaseLoan::get_command() { return CMD_DECREASE_LOAN; } -static constexpr auto _DecreaseLoan_dispatch = MakeDispatchTable(); +static constexpr auto _DecreaseLoan_dispatch = MakeDispatchTable(); bool DecreaseLoan::_post(::CommandCallback *callback) { return _DecreaseLoan_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->cmd, this->amount); } @@ -1186,7 +1186,7 @@ CommandCost DecreaseLoan::_do(DoCommandFlag flags) { } Commands Pause::get_command() { return CMD_PAUSE; } -static constexpr auto _Pause_dispatch = MakeDispatchTable(); +static constexpr auto _Pause_dispatch = MakeDispatchTable(); bool Pause::_post(::CommandCallback *callback) { return _Pause_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->mode, this->pause); } @@ -1195,7 +1195,7 @@ CommandCost Pause::_do(DoCommandFlag flags) { } Commands WantEnginePreview::get_command() { return CMD_WANT_ENGINE_PREVIEW; } -static constexpr auto _WantEnginePreview_dispatch = MakeDispatchTable(); +static constexpr auto _WantEnginePreview_dispatch = MakeDispatchTable(); bool WantEnginePreview::_post(::CommandCallback *callback) { return _WantEnginePreview_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->engine_id); } @@ -1204,7 +1204,7 @@ CommandCost WantEnginePreview::_do(DoCommandFlag flags) { } Commands EngineCtrl::get_command() { return CMD_ENGINE_CTRL; } -static constexpr auto _EngineCtrl_dispatch = MakeDispatchTable(); +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); } @@ -1213,7 +1213,7 @@ CommandCost EngineCtrl::_do(DoCommandFlag flags) { } Commands RenameEngine::get_command() { return CMD_RENAME_ENGINE; } -static constexpr auto _RenameEngine_dispatch = MakeDispatchTable(); +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); } @@ -1222,7 +1222,7 @@ CommandCost RenameEngine::_do(DoCommandFlag flags) { } Commands SetVehicleVisibility::get_command() { return CMD_SET_VEHICLE_VISIBILITY; } -static constexpr auto _SetVehicleVisibility_dispatch = MakeDispatchTable(); +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); } @@ -1231,7 +1231,7 @@ CommandCost SetVehicleVisibility::_do(DoCommandFlag flags) { } 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); } @@ -1240,7 +1240,7 @@ CommandCost BuildBridge::_do(DoCommandFlag flags) { } 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); } @@ -1249,7 +1249,7 @@ CommandCost BuildTunnel::_do(DoCommandFlag flags) { } Commands CreateGroup::get_command() { return CMD_CREATE_GROUP; } -static constexpr auto _CreateGroup_dispatch = MakeDispatchTable(); +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); } @@ -1258,7 +1258,7 @@ CommandCost CreateGroup::_do(DoCommandFlag flags) { } Commands AlterGroup::get_command() { return CMD_ALTER_GROUP; } -static constexpr auto _AlterGroup_dispatch = MakeDispatchTable(); +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); } @@ -1267,7 +1267,7 @@ CommandCost AlterGroup::_do(DoCommandFlag flags) { } Commands DeleteGroup::get_command() { return CMD_DELETE_GROUP; } -static constexpr auto _DeleteGroup_dispatch = MakeDispatchTable(); +static constexpr auto _DeleteGroup_dispatch = MakeDispatchTable(); bool DeleteGroup::_post(::CommandCallback *callback) { return _DeleteGroup_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->group_id); } @@ -1276,7 +1276,7 @@ CommandCost DeleteGroup::_do(DoCommandFlag flags) { } Commands AddVehicleGroup::get_command() { return CMD_ADD_VEHICLE_GROUP; } -static constexpr auto _AddVehicleGroup_dispatch = MakeDispatchTable(); +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); } @@ -1285,7 +1285,7 @@ CommandCost AddVehicleGroup::_do(DoCommandFlag flags) { } Commands AddSharedVehicleGroup::get_command() { return CMD_ADD_SHARED_VEHICLE_GROUP; } -static constexpr auto _AddSharedVehicleGroup_dispatch = MakeDispatchTable(); +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); } @@ -1294,7 +1294,7 @@ CommandCost AddSharedVehicleGroup::_do(DoCommandFlag flags) { } Commands RemoveAllVehiclesGroup::get_command() { return CMD_REMOVE_ALL_VEHICLES_GROUP; } -static constexpr auto _RemoveAllVehiclesGroup_dispatch = MakeDispatchTable(); +static constexpr auto _RemoveAllVehiclesGroup_dispatch = MakeDispatchTable(); bool RemoveAllVehiclesGroup::_post(::CommandCallback *callback) { return _RemoveAllVehiclesGroup_dispatch[FindCallbackIndex(callback)](this->error, this->tile, this->group_id); } @@ -1303,7 +1303,7 @@ CommandCost RemoveAllVehiclesGroup::_do(DoCommandFlag flags) { } Commands SetGroupFlag::get_command() { return CMD_SET_GROUP_FLAG; } -static constexpr auto _SetGroupFlag_dispatch = MakeDispatchTable(); +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); } @@ -1312,7 +1312,7 @@ CommandCost SetGroupFlag::_do(DoCommandFlag flags) { } Commands SetGroupLivery::get_command() { return CMD_SET_GROUP_LIVERY; } -static constexpr auto _SetGroupLivery_dispatch = MakeDispatchTable(); +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); } diff --git a/src/citymania/generated/cm_gen_commands.hpp b/src/citymania/generated/cm_gen_commands.hpp index cafc57c10e..568f8944db 100644 --- a/src/citymania/generated/cm_gen_commands.hpp +++ b/src/citymania/generated/cm_gen_commands.hpp @@ -47,9 +47,9 @@ namespace cmd { class CreateStoryPage: public Command { public: CompanyID company; - const std::string &text; + const std::string & text; - CreateStoryPage(CompanyID company, const std::string &text) + CreateStoryPage(CompanyID company, const std::string & text) :company{company}, text{text} {} ~CreateStoryPage() override {} @@ -63,11 +63,11 @@ public: StoryPageID page_id; StoryPageElementType type; uint32 reference; - const std::string &text; + const std::string & text; - CreateStoryPageElement(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) + 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} {} ~CreateStoryPageElement() override {} @@ -80,11 +80,11 @@ class UpdateStoryPageElement: public Command { public: StoryPageElementID page_element_id; uint32 reference; - const std::string &text; + const std::string & text; - UpdateStoryPageElement(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) + 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} {} ~UpdateStoryPageElement() override {} @@ -96,9 +96,9 @@ public: class SetStoryPageTitle: public Command { public: StoryPageID page_id; - const std::string &text; + const std::string & text; - SetStoryPageTitle(StoryPageID page_id, const std::string &text) + SetStoryPageTitle(StoryPageID page_id, const std::string & text) :page_id{page_id}, text{text} {} ~SetStoryPageTitle() override {} @@ -229,9 +229,9 @@ public: class RenameWaypoint: public Command { public: StationID waypoint_id; - const std::string &text; + const std::string & text; - RenameWaypoint(StationID waypoint_id, const std::string &text) + RenameWaypoint(StationID waypoint_id, const std::string & text) :waypoint_id{waypoint_id}, text{text} {} ~RenameWaypoint() override {} @@ -355,9 +355,9 @@ public: class RenameStation: public Command { public: StationID station_id; - const std::string &text; + const std::string & text; - RenameStation(StationID station_id, const std::string &text) + RenameStation(StationID station_id, const std::string & text) :station_id{station_id}, text{text} {} ~RenameStation() override {} @@ -382,11 +382,11 @@ public: class CreateGoal: public Command { public: CompanyID company; - GoalType type; - GoalTypeID dest; - const std::string &text; + ::GoalType type; + ::GoalTypeID dest; + const std::string & text; - CreateGoal(CompanyID company, GoalType type, GoalTypeID dest, const std::string &text) + CreateGoal(CompanyID company, ::GoalType type, ::GoalTypeID dest, const std::string & text) :company{company}, type{type}, dest{dest}, text{text} {} ~CreateGoal() override {} @@ -397,9 +397,9 @@ public: class RemoveGoal: public Command { public: - GoalID goal; + ::GoalID goal; - RemoveGoal(GoalID goal) + RemoveGoal(::GoalID goal) :goal{goal} {} ~RemoveGoal() override {} @@ -410,10 +410,10 @@ public: class SetGoalText: public Command { public: - GoalID goal; - const std::string &text; + ::GoalID goal; + const std::string & text; - SetGoalText(GoalID goal, const std::string &text) + SetGoalText(::GoalID goal, const std::string & text) :goal{goal}, text{text} {} ~SetGoalText() override {} @@ -424,10 +424,10 @@ public: class SetGoalProgress: public Command { public: - GoalID goal; - const std::string &text; + ::GoalID goal; + const std::string & text; - SetGoalProgress(GoalID goal, const std::string &text) + SetGoalProgress(::GoalID goal, const std::string & text) :goal{goal}, text{text} {} ~SetGoalProgress() override {} @@ -438,10 +438,10 @@ public: class SetGoalCompleted: public Command { public: - GoalID goal; + ::GoalID goal; bool completed; - SetGoalCompleted(GoalID goal, bool completed) + SetGoalCompleted(::GoalID goal, bool completed) :goal{goal}, completed{completed} {} ~SetGoalCompleted() override {} @@ -457,9 +457,9 @@ public: bool is_client; uint32 button_mask; GoalQuestionType type; - const std::string &text; + const std::string & text; - GoalQuestion(uint16 uniqueid, uint16 target, bool is_client, uint32 button_mask, GoalQuestionType type, const std::string &text) + GoalQuestion(uint16 uniqueid, uint16 target, bool is_client, uint32 button_mask, GoalQuestionType type, const std::string & text) :uniqueid{uniqueid}, target{target}, is_client{is_client}, button_mask{button_mask}, type{type}, text{text} {} ~GoalQuestion() override {} @@ -484,10 +484,10 @@ public: class ChangeSetting: public Command { public: - const std::string &name; + const std::string & name; int32 value; - ChangeSetting(const std::string &name, int32 value) + ChangeSetting(const std::string & name, int32 value) :name{name}, value{value} {} ~ChangeSetting() override {} @@ -498,10 +498,10 @@ public: class ChangeCompanySetting: public Command { public: - const std::string &name; + const std::string & name; int32 value; - ChangeCompanySetting(const std::string &name, int32 value) + ChangeCompanySetting(const std::string & name, int32 value) :name{name}, value{value} {} ~ChangeCompanySetting() override {} @@ -516,9 +516,9 @@ public: NewsReferenceType reftype1; CompanyID company; uint32 reference; - const std::string &text; + const std::string & text; - CustomNewsItem(NewsType type, NewsReferenceType reftype1, CompanyID company, uint32 reference, const std::string &text) + CustomNewsItem(NewsType type, NewsReferenceType reftype1, CompanyID company, uint32 reference, const std::string & text) :type{type}, reftype1{reftype1}, company{company}, reference{reference}, text{text} {} ~CustomNewsItem() override {} @@ -932,11 +932,11 @@ public: class CreateLeagueTable: public Command { public: - const std::string &title; - const std::string &header; - const std::string &footer; + const std::string & title; + const std::string & header; + const std::string & footer; - CreateLeagueTable(const std::string &title, const std::string &header, const std::string &footer) + CreateLeagueTable(const std::string & title, const std::string & header, const std::string & footer) :title{title}, header{header}, footer{footer} {} ~CreateLeagueTable() override {} @@ -950,12 +950,12 @@ public: LeagueTableID table; int64 rating; CompanyID company; - const std::string &text; - const std::string &score; + const std::string & text; + const std::string & score; LinkType link_type; LinkTargetID link_target; - CreateLeagueTableElement(LeagueTableID table, int64 rating, CompanyID company, const std::string &text, const std::string &score, LinkType link_type, LinkTargetID link_target) + CreateLeagueTableElement(LeagueTableID table, int64 rating, CompanyID company, const std::string & text, const std::string & score, LinkType link_type, LinkTargetID link_target) :table{table}, rating{rating}, company{company}, text{text}, score{score}, link_type{link_type}, link_target{link_target} {} ~CreateLeagueTableElement() override {} @@ -968,11 +968,11 @@ class UpdateLeagueTableElementData: public Command { public: LeagueTableElementID element; CompanyID company; - const std::string &text; + const std::string & text; LinkType link_type; LinkTargetID link_target; - UpdateLeagueTableElementData(LeagueTableElementID element, CompanyID company, const std::string &text, LinkType link_type, LinkTargetID link_target) + UpdateLeagueTableElementData(LeagueTableElementID element, CompanyID company, const std::string & text, LinkType link_type, LinkTargetID link_target) :element{element}, company{company}, text{text}, link_type{link_type}, link_target{link_target} {} ~UpdateLeagueTableElementData() override {} @@ -985,9 +985,9 @@ class UpdateLeagueTableElementScore: public Command { public: LeagueTableElementID element; int64 rating; - const std::string &score; + const std::string & score; - UpdateLeagueTableElementScore(LeagueTableElementID element, int64 rating, const std::string &score) + UpdateLeagueTableElementScore(LeagueTableElementID element, int64 rating, const std::string & score) :element{element}, rating{rating}, score{score} {} ~UpdateLeagueTableElementScore() override {} @@ -1011,11 +1011,11 @@ public: class PlaceSign: public Command { public: - const std::string &text; + const std::string & text; - PlaceSign(const std::string &text) + PlaceSign(const std::string & text) :text{text} {} - PlaceSign(TileIndex tile, const std::string &text) + PlaceSign(TileIndex tile, const std::string & text) :Command{tile}, text{text} {} ~PlaceSign() override {} @@ -1027,9 +1027,9 @@ public: class RenameSign: public Command { public: SignID sign_id; - const std::string &text; + const std::string & text; - RenameSign(SignID sign_id, const std::string &text) + RenameSign(SignID sign_id, const std::string & text) :sign_id{sign_id}, text{text} {} ~RenameSign() override {} @@ -1094,9 +1094,9 @@ class SendVehicleToDepot: public Command { public: VehicleID veh_id; DepotCommand depot_cmd; - const VehicleListIdentifier &vli; + const VehicleListIdentifier & vli; - SendVehicleToDepot(VehicleID veh_id, DepotCommand depot_cmd, const VehicleListIdentifier &vli) + SendVehicleToDepot(VehicleID veh_id, DepotCommand depot_cmd, const VehicleListIdentifier & vli) :veh_id{veh_id}, depot_cmd{depot_cmd}, vli{vli} {} ~SendVehicleToDepot() override {} @@ -1124,9 +1124,9 @@ public: class RenameVehicle: public Command { public: VehicleID veh_id; - const std::string &text; + const std::string & text; - RenameVehicle(VehicleID veh_id, const std::string &text) + RenameVehicle(VehicleID veh_id, const std::string & text) :veh_id{veh_id}, text{text} {} ~RenameVehicle() override {} @@ -1169,11 +1169,11 @@ class MassStartStopVehicle: public Command { public: bool do_start; bool vehicle_list_window; - const VehicleListIdentifier &vli; + const VehicleListIdentifier & vli; - MassStartStopVehicle(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) + 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} {} ~MassStartStopVehicle() override {} @@ -1248,9 +1248,9 @@ public: class RenameDepot: public Command { public: DepotID depot_id; - const std::string &text; + const std::string & text; - RenameDepot(DepotID depot_id, const std::string &text) + RenameDepot(DepotID depot_id, const std::string & text) :depot_id{depot_id}, text{text} {} ~RenameDepot() override {} @@ -1469,9 +1469,9 @@ public: class RenameCompany: public Command { public: - const std::string &text; + const std::string & text; - RenameCompany(const std::string &text) + RenameCompany(const std::string & text) :text{text} {} ~RenameCompany() override {} @@ -1482,9 +1482,9 @@ public: class RenamePresident: public Command { public: - const std::string &text; + const std::string & text; - RenamePresident(const std::string &text) + RenamePresident(const std::string & text) :text{text} {} ~RenamePresident() override {} @@ -1557,11 +1557,11 @@ public: TownLayout layout; bool random_location; uint32 townnameparts; - const std::string &text; + const std::string & text; - FoundTown(TownSize size, bool city, TownLayout layout, bool random_location, 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) + 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} {} ~FoundTown() override {} @@ -1573,9 +1573,9 @@ public: class RenameTown: public Command { public: TownID town_id; - const std::string &text; + const std::string & text; - RenameTown(TownID town_id, const std::string &text) + RenameTown(TownID town_id, const std::string & text) :town_id{town_id}, text{text} {} ~RenameTown() override {} @@ -1645,9 +1645,9 @@ public: class TownSetText: public Command { public: TownID town_id; - const std::string &text; + const std::string & text; - TownSetText(TownID town_id, const std::string &text) + TownSetText(TownID town_id, const std::string & text) :town_id{town_id}, text{text} {} ~TownSetText() override {} @@ -1720,9 +1720,9 @@ public: IndustryAction action; IndustryControlFlags ctlflags; Owner company_id; - const std::string &text; + const std::string & text; - IndustryCtrl(IndustryID ind_id, IndustryAction action, IndustryControlFlags ctlflags, Owner company_id, const std::string &text) + IndustryCtrl(IndustryID ind_id, IndustryAction action, IndustryControlFlags ctlflags, Owner company_id, const std::string & text) :ind_id{ind_id}, action{action}, ctlflags{ctlflags}, company_id{company_id}, text{text} {} ~IndustryCtrl() override {} @@ -1779,9 +1779,9 @@ class InsertOrder: public Command { public: VehicleID veh; VehicleOrderID sel_ord; - const Order &new_order; + const Order & new_order; - InsertOrder(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() override {} @@ -1953,9 +1953,9 @@ public: class RenameEngine: public Command { public: EngineID engine_id; - const std::string &text; + const std::string & text; - RenameEngine(EngineID engine_id, const std::string &text) + RenameEngine(EngineID engine_id, const std::string & text) :engine_id{engine_id}, text{text} {} ~RenameEngine() override {} @@ -2031,9 +2031,9 @@ public: AlterGroupMode mode; GroupID group_id; GroupID parent_id; - const std::string &text; + const std::string & text; - AlterGroup(AlterGroupMode mode, GroupID group_id, GroupID parent_id, const std::string &text) + AlterGroup(AlterGroupMode mode, GroupID group_id, GroupID parent_id, const std::string & text) :mode{mode}, group_id{group_id}, parent_id{parent_id}, text{text} {} ~AlterGroup() override {}