Codechange: Template DoCommandP to automagically reflect the parameters of the command proc.

When finished, this will allow each command handler to take individually
different parameters, obliviating the need for bit-packing.
This commit is contained in:
Michael Lutz
2021-10-31 19:39:09 +01:00
parent e740c24eb7
commit 0f64ee5ce1
47 changed files with 375 additions and 332 deletions

View File

@@ -25,6 +25,7 @@
#include "window_func.h"
#include "zoom_func.h"
#include "terraform_cmd.h"
#include "object_cmd.h"
#include "widgets/object_widget.h"
@@ -542,8 +543,8 @@ public:
void OnPlaceObject(Point pt, TileIndex tile) override
{
ObjectClass *objclass = ObjectClass::Get(_selected_object_class);
DoCommandP(CMD_BUILD_OBJECT, STR_ERROR_CAN_T_BUILD_OBJECT, CcTerraform,
tile, objclass->GetSpec(_selected_object_index)->Index(), _selected_object_view);
Command<CMD_BUILD_OBJECT>::Post(STR_ERROR_CAN_T_BUILD_OBJECT, CcTerraform,
tile, objclass->GetSpec(_selected_object_index)->Index(), _selected_object_view, {});
}
void OnPlaceObjectAbort() override