mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-22 14:24:33 +01:00
* Moving all definitions from B...Actions to source * Moving all definitions from C...Actions to source * Moving all definitions from F...Actions to source * Moving all definitions from G...Actions to source * Moving all definitions from L...Actions to source * Moving all definitions from M...Actions to source * Moving all definitions from N...Actions to source * Moving all definitions from P...Actions to source
52 lines
1.3 KiB
C++
52 lines
1.3 KiB
C++
/*****************************************************************************
|
|
* Copyright (c) 2014-2020 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"
|
|
|
|
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::Ptr ClimateSetAction::Query() const
|
|
{
|
|
if (_climate >= ClimateType::Count)
|
|
{
|
|
return std::make_unique<GameActions::Result>(GameActions::Status::InvalidParameters, STR_INVALID_CLIMATE_ID, STR_NONE);
|
|
}
|
|
|
|
return std::make_unique<GameActions::Result>();
|
|
}
|
|
|
|
GameActions::Result::Ptr ClimateSetAction::Execute() const
|
|
{
|
|
gClimate = ClimateType{ _climate };
|
|
|
|
gfx_invalidate_screen();
|
|
|
|
return std::make_unique<GameActions::Result>();
|
|
}
|