Do style fixes

This commit is contained in:
Ted John 2017-07-21 18:14:20 +01:00 committed by Michał Janiszewski
parent b068331db2
commit 675b1b8cf4
5 changed files with 69 additions and 39 deletions

View File

@ -141,12 +141,12 @@ public:
typedef IGameAction *(*GameActionFactory)();
template<uint32 _TYPE, uint16 _ACTFLAGS>
template<uint32 TType, uint16 TActionFlags>
struct GameAction : public IGameAction
{
public:
constexpr static uint32 Type = _TYPE;
constexpr static uint16 ActionFlags = _ACTFLAGS;
constexpr static uint32 Type = TType;
constexpr static uint16 ActionFlags = TActionFlags;
private:
uint32 _playerId; // Callee
@ -235,22 +235,21 @@ public:
namespace GameActions
{
void Initialize();
void Register();
IGameAction::Ptr Create(uint32 id);
GameActionResult::Ptr Query(const IGameAction * action);
GameActionResult::Ptr Execute(const IGameAction * action);
void Initialize();
void Register();
IGameAction::Ptr Create(uint32 id);
GameActionResult::Ptr Query(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()
{
GameActionFactory factory = []() -> IGameAction *
template<typename T>
static GameActionFactory Register()
{
return new T();
};
Register(T::Type, factory);
return factory;
}
GameActionFactory factory = []() -> IGameAction *
{
return new T();
};
Register(T::Type, factory);
return factory;
}
}

View File

@ -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 "SetParkEntranceFeeAction.hpp"
#include "RideCreateAction.hpp"

View File

@ -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 "PlaceParkEntranceAction.hpp"
#include "SetParkEntranceFeeAction.hpp"
#include "RideCreateAction.hpp"
#include "RideSetStatus.hpp"
namespace GameActions {
void Register()
namespace GameActions
{
Register<SetParkEntranceFeeAction>();
Register<PlaceParkEntranceAction>();
Register<RideCreateAction>();
Register<RideSetStatusAction>();
void Register()
{
Register<SetParkEntranceFeeAction>();
Register<PlaceParkEntranceAction>();
Register<RideCreateAction>();
Register<RideSetStatusAction>();
}
}
}

View File

@ -22,13 +22,13 @@
extern "C"
{
#include "../localisation/date.h"
#include "../cheats.h"
#include "../interface/window.h"
#include "../world/park.h"
#include "../rct1.h"
#include "../ride/ride_data.h"
#include "../ride/ride.h"
#include "../localisation/date.h"
#include "../cheats.h"
#include "../interface/window.h"
#include "../world/park.h"
#include "../rct1.h"
#include "../ride/ride_data.h"
#include "../ride/ride.h"
}
struct RideCreateGameActionResult : public GameActionResult {

View File

@ -22,10 +22,10 @@
extern "C"
{
#include "../cheats.h"
#include "../interface/window.h"
#include "../world/park.h"
#include "../ride/ride.h"
#include "../cheats.h"
#include "../interface/window.h"
#include "../world/park.h"
#include "../ride/ride.h"
}
struct RideSetStatusAction : public GameAction<GAME_COMMAND_SET_RIDE_STATUS, GA_FLAGS::ALLOW_WHILE_PAUSED>