From 675b1b8cf4a2cf899da41f70dd2f6da6ddaaf723 Mon Sep 17 00:00:00 2001 From: Ted John Date: Fri, 21 Jul 2017 18:14:20 +0100 Subject: [PATCH] Do style fixes --- src/openrct2/actions/GameAction.h | 37 +++++++++---------- src/openrct2/actions/GameActionCompat.cpp | 16 ++++++++ .../actions/GameActionRegistration.cpp | 33 ++++++++++++----- src/openrct2/actions/RideCreateAction.hpp | 14 +++---- src/openrct2/actions/RideSetStatus.hpp | 8 ++-- 5 files changed, 69 insertions(+), 39 deletions(-) diff --git a/src/openrct2/actions/GameAction.h b/src/openrct2/actions/GameAction.h index 3c47a19b5c..a71abbf7ea 100644 --- a/src/openrct2/actions/GameAction.h +++ b/src/openrct2/actions/GameAction.h @@ -141,12 +141,12 @@ public: typedef IGameAction *(*GameActionFactory)(); -template +template 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 -static GameActionFactory Register() -{ - GameActionFactory factory = []() -> IGameAction * + template + static GameActionFactory Register() { - return new T(); - }; - Register(T::Type, factory); - return factory; -} + GameActionFactory factory = []() -> IGameAction * + { + return new T(); + }; + Register(T::Type, factory); + return factory; + } } diff --git a/src/openrct2/actions/GameActionCompat.cpp b/src/openrct2/actions/GameActionCompat.cpp index 906cdbba0c..70549d868a 100644 --- a/src/openrct2/actions/GameActionCompat.cpp +++ b/src/openrct2/actions/GameActionCompat.cpp @@ -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" diff --git a/src/openrct2/actions/GameActionRegistration.cpp b/src/openrct2/actions/GameActionRegistration.cpp index 5904db9ef4..df8433e219 100644 --- a/src/openrct2/actions/GameActionRegistration.cpp +++ b/src/openrct2/actions/GameActionRegistration.cpp @@ -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(); - Register(); - Register(); - Register(); + void Register() + { + Register(); + Register(); + Register(); + Register(); + } } - -} \ No newline at end of file diff --git a/src/openrct2/actions/RideCreateAction.hpp b/src/openrct2/actions/RideCreateAction.hpp index 38a25c8ca8..0976f41cf2 100644 --- a/src/openrct2/actions/RideCreateAction.hpp +++ b/src/openrct2/actions/RideCreateAction.hpp @@ -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 { diff --git a/src/openrct2/actions/RideSetStatus.hpp b/src/openrct2/actions/RideSetStatus.hpp index 69a4d9f43c..456551abe4 100644 --- a/src/openrct2/actions/RideSetStatus.hpp +++ b/src/openrct2/actions/RideSetStatus.hpp @@ -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