Codechange: Use lambdas instead of CommandContainer to manage station picker commands.

This commit is contained in:
Michael Lutz
2021-10-29 00:56:07 +02:00
parent a05fd7aa50
commit 996b16de70
9 changed files with 110 additions and 84 deletions

View File

@@ -13,6 +13,8 @@
#include "command_type.h"
#include "tilearea_type.h"
#include "window_type.h"
#include "station_type.h"
#include <functional>
/** Types of cargo to display for station coverage. */
@@ -25,7 +27,9 @@ enum StationCoverageType {
int DrawStationCoverageAreaText(int left, int right, int top, StationCoverageType sct, int rad, bool supplies);
void CheckRedrawStationCoverage(const Window *w);
void ShowSelectStationIfNeeded(const CommandContainer &cmd, TileArea ta);
void ShowSelectWaypointIfNeeded(const CommandContainer &cmd, TileArea ta);
using StationPickerCmdProc = std::function<bool(bool test, StationID to_join)>;
void ShowSelectStationIfNeeded(TileArea ta, StationPickerCmdProc proc);
void ShowSelectWaypointIfNeeded(TileArea ta, StationPickerCmdProc proc);
#endif /* STATION_GUI_H */