mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-24 08:12:53 +01:00
Purge ClimateSetAction game action
This commit is contained in:
@@ -1,57 +0,0 @@
|
||||
/*****************************************************************************
|
||||
* Copyright (c) 2014-2025 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.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "ClimateSetAction.h"
|
||||
|
||||
#include "../Diagnostic.h"
|
||||
#include "../GameState.h"
|
||||
|
||||
using namespace OpenRCT2;
|
||||
|
||||
ClimateSetAction::ClimateSetAction(ClimateType climate)
|
||||
: _climate(climate)
|
||||
{
|
||||
}
|
||||
|
||||
void ClimateSetAction::AcceptParameters(GameActionParameterVisitor& visitor)
|
||||
{
|
||||
visitor.Visit("climate", _climate);
|
||||
}
|
||||
|
||||
uint16_t ClimateSetAction::GetActionFlags() const
|
||||
{
|
||||
return GameAction::GetActionFlags();
|
||||
}
|
||||
|
||||
void ClimateSetAction::Serialise(DataSerialiser& stream)
|
||||
{
|
||||
GameAction::Serialise(stream);
|
||||
|
||||
stream << DS_TAG(_climate);
|
||||
}
|
||||
|
||||
GameActions::Result ClimateSetAction::Query() const
|
||||
{
|
||||
if (_climate >= ClimateType::Count)
|
||||
{
|
||||
LOG_ERROR("Invalid climate type %u", _climate);
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_INVALID_CLIMATE_ID, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
}
|
||||
|
||||
return GameActions::Result();
|
||||
}
|
||||
|
||||
GameActions::Result ClimateSetAction::Execute() const
|
||||
{
|
||||
ClimateReset();
|
||||
|
||||
GfxInvalidateScreen();
|
||||
|
||||
return GameActions::Result();
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
/*****************************************************************************
|
||||
* Copyright (c) 2014-2025 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 "../world/Climate.h"
|
||||
#include "GameAction.h"
|
||||
|
||||
class ClimateSetAction final : public GameActionBase<GameCommand::SetClimate>
|
||||
{
|
||||
private:
|
||||
ClimateType _climate{};
|
||||
|
||||
public:
|
||||
ClimateSetAction() = default;
|
||||
ClimateSetAction(ClimateType climate);
|
||||
|
||||
void AcceptParameters(GameActionParameterVisitor& visitor) override;
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
void Serialise(DataSerialiser& stream) override;
|
||||
OpenRCT2::GameActions::Result Query() const override;
|
||||
OpenRCT2::GameActions::Result Execute() const override;
|
||||
};
|
||||
@@ -15,7 +15,6 @@
|
||||
#include "BannerSetStyleAction.h"
|
||||
#include "CheatSetAction.h"
|
||||
#include "ClearAction.h"
|
||||
#include "ClimateSetAction.h"
|
||||
#include "CustomAction.h"
|
||||
#include "FootpathAdditionPlaceAction.h"
|
||||
#include "FootpathAdditionRemoveAction.h"
|
||||
@@ -136,7 +135,6 @@ namespace OpenRCT2::GameActions
|
||||
REGISTER_ACTION(BannerSetColourAction);
|
||||
REGISTER_ACTION(BannerSetNameAction);
|
||||
REGISTER_ACTION(BannerSetStyleAction);
|
||||
REGISTER_ACTION(ClimateSetAction);
|
||||
REGISTER_ACTION(FootpathPlaceAction);
|
||||
REGISTER_ACTION(FootpathLayoutPlaceAction);
|
||||
REGISTER_ACTION(FootpathRemoveAction);
|
||||
|
||||
@@ -84,7 +84,6 @@
|
||||
<ClInclude Include="actions\BannerSetStyleAction.h" />
|
||||
<ClInclude Include="actions\CheatSetAction.h" />
|
||||
<ClInclude Include="actions\ClearAction.h" />
|
||||
<ClInclude Include="actions\ClimateSetAction.h" />
|
||||
<ClInclude Include="actions\CustomAction.h" />
|
||||
<ClInclude Include="actions\FootpathLayoutPlaceAction.h" />
|
||||
<ClInclude Include="actions\FootpathPlaceAction.h" />
|
||||
@@ -662,7 +661,6 @@
|
||||
<ClCompile Include="actions\BannerSetStyleAction.cpp" />
|
||||
<ClCompile Include="actions\CheatSetAction.cpp" />
|
||||
<ClCompile Include="actions\ClearAction.cpp" />
|
||||
<ClCompile Include="actions\ClimateSetAction.cpp" />
|
||||
<ClCompile Include="actions\CustomAction.cpp" />
|
||||
<ClCompile Include="actions\FootpathAdditionPlaceAction.cpp" />
|
||||
<ClCompile Include="actions\FootpathAdditionRemoveAction.cpp" />
|
||||
|
||||
@@ -864,7 +864,7 @@ namespace OpenRCT2
|
||||
if (version < kClimateObjectsVersion)
|
||||
{
|
||||
// Legacy climate is converted elsewhere, so we can skip it here.
|
||||
cs.Ignore<ClimateType>();
|
||||
cs.Ignore<RCT12::ClimateType>();
|
||||
}
|
||||
|
||||
cs.ReadWrite(gameState.WeatherUpdateTimer);
|
||||
|
||||
@@ -14,16 +14,6 @@
|
||||
#include <array>
|
||||
#include <cstdint>
|
||||
|
||||
// TODO: refactor usage and remove
|
||||
enum class ClimateType : uint8_t
|
||||
{
|
||||
CoolAndWet,
|
||||
Warm,
|
||||
HotAndDry,
|
||||
Cold,
|
||||
Count
|
||||
};
|
||||
|
||||
enum class WeatherType : uint8_t
|
||||
{
|
||||
Sunny,
|
||||
|
||||
Reference in New Issue
Block a user