1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-26 16:24:35 +01:00
Files
OpenRCT2/src/openrct2/actions/ClearAction.h
James103 1d8dc111f1 Replace 2023 with 2024 in copyright headers (#21139)
Replace all instances of the year 2023 with 2024 in all copyright headers
2024-01-01 12:52:28 +01:00

58 lines
1.7 KiB
C++

/*****************************************************************************
* Copyright (c) 2014-2024 OpenRCT2 developers
*
* For a complete list of all authors, please refer to contributors.md
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
*
* OpenRCT2 is licensed under the GNU General Public License version 3.
*****************************************************************************/
#pragma once
#include "../OpenRCT2.h"
#include "../management/Finance.h"
#include "GameAction.h"
using namespace OpenRCT2;
using ClearableItems = uint8_t;
namespace CLEARABLE_ITEMS
{
constexpr ClearableItems SCENERY_SMALL = 1 << 0;
constexpr ClearableItems SCENERY_LARGE = 1 << 1;
constexpr ClearableItems SCENERY_FOOTPATH = 1 << 2;
} // namespace CLEARABLE_ITEMS
class ClearAction final : public GameActionBase<GameCommand::ClearScenery>
{
private:
MapRange _range;
ClearableItems _itemsToClear{};
public:
ClearAction() = default;
ClearAction(MapRange range, ClearableItems itemsToClear);
void AcceptParameters(GameActionParameterVisitor& visitor) override;
uint16_t GetActionFlags() const override;
void Serialise(DataSerialiser& stream) override;
GameActions::Result Query() const override;
GameActions::Result Execute() const override;
private:
GameActions::Result CreateResult() const;
GameActions::Result QueryExecute(bool executing) const;
money64 ClearSceneryFromTile(const CoordsXY& tilePos, bool executing) const;
/**
* Function to clear the flag that is set to prevent cost duplication
* when using the clear scenery tool with large scenery.
*/
static void ResetClearLargeSceneryFlag();
static bool MapCanClearAt(const CoordsXY& location);
};