1 /*****************************************************************************
2  * Copyright (c) 2014-2020 OpenRCT2 developers
3  *
4  * For a complete list of all authors, please refer to contributors.md
5  * Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
6  *
7  * OpenRCT2 is licensed under the GNU General Public License version 3.
8  *****************************************************************************/
9 
10 #pragma once
11 
12 #include "GameAction.h"
13 
14 class TrackSetBrakeSpeedAction final : public GameActionBase<GameCommand::SetBrakesSpeed>
15 {
16 private:
17     CoordsXYZ _loc;
18     track_type_t _trackType{};
19     uint8_t _brakeSpeed{};
20 
21 public:
22     TrackSetBrakeSpeedAction() = default;
23     TrackSetBrakeSpeedAction(const CoordsXYZ& loc, track_type_t trackType, uint8_t brakeSpeed);
24 
25     void AcceptParameters(GameActionParameterVisitor& visitor) override;
26 
27     uint16_t GetActionFlags() const override final;
28 
29     void Serialise(DataSerialiser& stream) override;
30     GameActions::Result::Ptr Query() const override;
31     GameActions::Result::Ptr Execute() const override;
32 
33 private:
34     GameActions::Result::Ptr QueryExecute(bool isExecuting) const;
35 };
36