mirror of https://github.com/OpenRCT2/OpenRCT2.git
Do style fixes
This commit is contained in:
parent
b068331db2
commit
675b1b8cf4
|
@ -141,12 +141,12 @@ public:
|
||||||
|
|
||||||
typedef IGameAction *(*GameActionFactory)();
|
typedef IGameAction *(*GameActionFactory)();
|
||||||
|
|
||||||
template<uint32 _TYPE, uint16 _ACTFLAGS>
|
template<uint32 TType, uint16 TActionFlags>
|
||||||
struct GameAction : public IGameAction
|
struct GameAction : public IGameAction
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
constexpr static uint32 Type = _TYPE;
|
constexpr static uint32 Type = TType;
|
||||||
constexpr static uint16 ActionFlags = _ACTFLAGS;
|
constexpr static uint16 ActionFlags = TActionFlags;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
uint32 _playerId; // Callee
|
uint32 _playerId; // Callee
|
||||||
|
@ -235,22 +235,21 @@ public:
|
||||||
|
|
||||||
namespace GameActions
|
namespace GameActions
|
||||||
{
|
{
|
||||||
void Initialize();
|
void Initialize();
|
||||||
void Register();
|
void Register();
|
||||||
IGameAction::Ptr Create(uint32 id);
|
IGameAction::Ptr Create(uint32 id);
|
||||||
GameActionResult::Ptr Query(const IGameAction * action);
|
GameActionResult::Ptr Query(const IGameAction * action);
|
||||||
GameActionResult::Ptr Execute(const IGameAction * action);
|
GameActionResult::Ptr Execute(const IGameAction * action);
|
||||||
|
GameActionFactory Register(uint32 id, GameActionFactory action);
|
||||||
|
|
||||||
GameActionFactory Register(uint32 id, GameActionFactory action);
|
template<typename T>
|
||||||
|
static GameActionFactory Register()
|
||||||
template<typename T>
|
|
||||||
static GameActionFactory Register()
|
|
||||||
{
|
|
||||||
GameActionFactory factory = []() -> IGameAction *
|
|
||||||
{
|
{
|
||||||
return new T();
|
GameActionFactory factory = []() -> IGameAction *
|
||||||
};
|
{
|
||||||
Register(T::Type, factory);
|
return new T();
|
||||||
return factory;
|
};
|
||||||
}
|
Register(T::Type, factory);
|
||||||
|
return factory;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,19 @@
|
||||||
|
#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers
|
||||||
|
/*****************************************************************************
|
||||||
|
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
|
||||||
|
*
|
||||||
|
* OpenRCT2 is the work of many authors, a full list can be found in contributors.md
|
||||||
|
* For more information, visit https://github.com/OpenRCT2/OpenRCT2
|
||||||
|
*
|
||||||
|
* OpenRCT2 is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* A full copy of the GNU General Public License can be found in licence.txt
|
||||||
|
*****************************************************************************/
|
||||||
|
#pragma endregion
|
||||||
|
|
||||||
#include "PlaceParkEntranceAction.hpp"
|
#include "PlaceParkEntranceAction.hpp"
|
||||||
#include "SetParkEntranceFeeAction.hpp"
|
#include "SetParkEntranceFeeAction.hpp"
|
||||||
#include "RideCreateAction.hpp"
|
#include "RideCreateAction.hpp"
|
||||||
|
|
|
@ -1,17 +1,32 @@
|
||||||
|
#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers
|
||||||
|
/*****************************************************************************
|
||||||
|
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
|
||||||
|
*
|
||||||
|
* OpenRCT2 is the work of many authors, a full list can be found in contributors.md
|
||||||
|
* For more information, visit https://github.com/OpenRCT2/OpenRCT2
|
||||||
|
*
|
||||||
|
* OpenRCT2 is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* A full copy of the GNU General Public License can be found in licence.txt
|
||||||
|
*****************************************************************************/
|
||||||
|
#pragma endregion
|
||||||
|
|
||||||
#include "GameAction.h"
|
#include "GameAction.h"
|
||||||
#include "PlaceParkEntranceAction.hpp"
|
#include "PlaceParkEntranceAction.hpp"
|
||||||
#include "SetParkEntranceFeeAction.hpp"
|
#include "SetParkEntranceFeeAction.hpp"
|
||||||
#include "RideCreateAction.hpp"
|
#include "RideCreateAction.hpp"
|
||||||
#include "RideSetStatus.hpp"
|
#include "RideSetStatus.hpp"
|
||||||
|
|
||||||
namespace GameActions {
|
namespace GameActions
|
||||||
|
|
||||||
void Register()
|
|
||||||
{
|
{
|
||||||
Register<SetParkEntranceFeeAction>();
|
void Register()
|
||||||
Register<PlaceParkEntranceAction>();
|
{
|
||||||
Register<RideCreateAction>();
|
Register<SetParkEntranceFeeAction>();
|
||||||
Register<RideSetStatusAction>();
|
Register<PlaceParkEntranceAction>();
|
||||||
|
Register<RideCreateAction>();
|
||||||
|
Register<RideSetStatusAction>();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
|
@ -22,13 +22,13 @@
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
#include "../localisation/date.h"
|
#include "../localisation/date.h"
|
||||||
#include "../cheats.h"
|
#include "../cheats.h"
|
||||||
#include "../interface/window.h"
|
#include "../interface/window.h"
|
||||||
#include "../world/park.h"
|
#include "../world/park.h"
|
||||||
#include "../rct1.h"
|
#include "../rct1.h"
|
||||||
#include "../ride/ride_data.h"
|
#include "../ride/ride_data.h"
|
||||||
#include "../ride/ride.h"
|
#include "../ride/ride.h"
|
||||||
}
|
}
|
||||||
|
|
||||||
struct RideCreateGameActionResult : public GameActionResult {
|
struct RideCreateGameActionResult : public GameActionResult {
|
||||||
|
|
|
@ -22,10 +22,10 @@
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
#include "../cheats.h"
|
#include "../cheats.h"
|
||||||
#include "../interface/window.h"
|
#include "../interface/window.h"
|
||||||
#include "../world/park.h"
|
#include "../world/park.h"
|
||||||
#include "../ride/ride.h"
|
#include "../ride/ride.h"
|
||||||
}
|
}
|
||||||
|
|
||||||
struct RideSetStatusAction : public GameAction<GAME_COMMAND_SET_RIDE_STATUS, GA_FLAGS::ALLOW_WHILE_PAUSED>
|
struct RideSetStatusAction : public GameAction<GAME_COMMAND_SET_RIDE_STATUS, GA_FLAGS::ALLOW_WHILE_PAUSED>
|
||||||
|
|
Loading…
Reference in New Issue