Play-/tools/McServTest/GameTestSheet.h

53 lines
1.1 KiB
C
Raw Permalink Normal View History

2014-11-15 23:22:29 -05:00
#pragma once
#include <vector>
#include <unordered_map>
#include "Stream.h"
class CGameTestSheet
{
public:
enum ENVIRONMENT_ACTION_TYPE
{
ENVIRONMENT_ACTION_NONE,
ENVIRONMENT_ACTION_CREATE_DIRECTORY,
ENVIRONMENT_ACTION_CREATE_FILE,
};
struct ENVIRONMENT_ACTION
{
2018-04-30 21:01:23 +01:00
ENVIRONMENT_ACTION_TYPE type = ENVIRONMENT_ACTION_NONE;
std::string name;
uint32 size = 0;
2014-11-15 23:22:29 -05:00
};
typedef std::vector<ENVIRONMENT_ACTION> EnvironmentActionArray;
typedef EnvironmentActionArray ENVIRONMENT;
typedef std::unordered_map<uint32, ENVIRONMENT> EnvironmentMap;
typedef std::vector<std::string> EntryArray;
struct TEST
{
2018-04-30 21:01:23 +01:00
std::string query;
uint32 environmentId = 0;
int32 maxEntries = 0;
int32 result = 0;
std::string currentDirectory;
EntryArray entries;
2014-11-15 23:22:29 -05:00
};
typedef std::vector<TEST> TestArray;
2023-12-13 12:02:31 -05:00
CGameTestSheet() = default;
2018-04-30 21:01:23 +01:00
CGameTestSheet(Framework::CStream&);
2023-12-13 12:02:31 -05:00
virtual ~CGameTestSheet() = default;
2014-11-15 23:22:29 -05:00
2018-04-30 21:01:23 +01:00
ENVIRONMENT GetEnvironment(uint32) const;
const TestArray& GetTests() const;
2014-11-15 23:22:29 -05:00
private:
2018-04-30 21:01:23 +01:00
void ParseSheet(Framework::CStream&);
2014-11-15 23:22:29 -05:00
2018-04-30 21:01:23 +01:00
EnvironmentMap m_environments;
TestArray m_tests;
2014-11-15 23:22:29 -05:00
};