1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-23 15:52:55 +01:00

Refactor PlatformEnvironment

This commit is contained in:
Ted John
2016-12-12 02:16:08 +00:00
parent 3e21e56b9e
commit e4345c3d11
2 changed files with 7 additions and 6 deletions

View File

@@ -22,17 +22,16 @@
extern "C"
{
#include "OpenRCT2.h"
#include "platform/platform.h"
}
class PlatformEnvironment : public IPlatformEnvironment
{
private:
std::string _basePath[4];
std::string _basePath[DIRBASE_COUNT];
public:
PlatformEnvironment(const std::string basePaths[4])
PlatformEnvironment(DIRBASE_VALUES basePaths)
{
for (int i = 0; i < 4; i++)
{
@@ -84,7 +83,7 @@ private:
static const char * FileNames[];
};
IPlatformEnvironment * CreatePlatformEnvironment(const std::string basePaths[4])
IPlatformEnvironment * CreatePlatformEnvironment(DIRBASE_VALUES basePaths)
{
return new PlatformEnvironment(basePaths);
}

View File

@@ -19,13 +19,15 @@
#include <string>
#include "common.h"
enum class DIRBASE
enum class DIRBASE : int
{
RCT1, // Base directory for original RollerCoaster Tycoon 1 content.
RCT2, // Base directory for original RollerCoaster Tycoon 2 content.
OPENRCT2, // Base directory for OpenRCT2 installation.
USER, // Base directory for OpenRCT2 user content.
};
constexpr int DIRBASE_COUNT = 4;
using DIRBASE_VALUES = std::string[DIRBASE_COUNT];
enum class DIRID
{
@@ -70,4 +72,4 @@ interface IPlatformEnvironment
virtual std::string GetFilePath(PATHID pathid) const abstract;
};
IPlatformEnvironment * CreatePlatformEnvironment(const std::string basePaths[4]);
IPlatformEnvironment * CreatePlatformEnvironment(DIRBASE_VALUES basePaths);