mirror of
https://github.com/luanti-org/luanti.git
synced 2025-09-15 18:57:08 +00:00
Move TestGameDef
to test.h header
This makes the test gamedef available to all test modules. I removed an unused include from test.h and included some stuff we use in test.h, since I had to modify the include list anyway for the change.
This commit is contained in:
parent
cf03296222
commit
45a5c96395
2 changed files with 31 additions and 25 deletions
|
@ -32,25 +32,6 @@ content_t t_CONTENT_BRICK;
|
||||||
//// TestGameDef
|
//// TestGameDef
|
||||||
////
|
////
|
||||||
|
|
||||||
class TestGameDef : public DummyGameDef {
|
|
||||||
public:
|
|
||||||
TestGameDef();
|
|
||||||
~TestGameDef() = default;
|
|
||||||
|
|
||||||
void defineSomeNodes();
|
|
||||||
|
|
||||||
bool joinModChannel(const std::string &channel);
|
|
||||||
bool leaveModChannel(const std::string &channel);
|
|
||||||
bool sendModChannelMessage(const std::string &channel, const std::string &message);
|
|
||||||
ModChannel *getModChannel(const std::string &channel)
|
|
||||||
{
|
|
||||||
return m_modchannel_mgr->getModChannel(channel);
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
std::unique_ptr<ModChannelMgr> m_modchannel_mgr;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
TestGameDef::TestGameDef() :
|
TestGameDef::TestGameDef() :
|
||||||
DummyGameDef(),
|
DummyGameDef(),
|
||||||
|
|
|
@ -4,15 +4,21 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <functional>
|
#include "dummygamedef.h"
|
||||||
#include <exception>
|
|
||||||
#include <sstream>
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
#include "irrlichttypes_bloated.h"
|
#include "irrlichttypes_bloated.h"
|
||||||
#include "porting.h"
|
|
||||||
#include "filesys.h"
|
#include "filesys.h"
|
||||||
#include "mapnode.h"
|
#include "mapnode.h"
|
||||||
|
#include "modchannels.h"
|
||||||
|
#include "porting.h"
|
||||||
|
|
||||||
|
#include <cstdio>
|
||||||
|
#include <functional>
|
||||||
|
#include <iostream>
|
||||||
|
#include <memory>
|
||||||
|
#include <sstream>
|
||||||
|
#include <string>
|
||||||
|
#include <utility>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
class TestFailedException { // don’t derive from std::exception to avoid accidental catch
|
class TestFailedException { // don’t derive from std::exception to avoid accidental catch
|
||||||
public:
|
public:
|
||||||
|
@ -105,6 +111,25 @@ public:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class TestGameDef : public DummyGameDef {
|
||||||
|
public:
|
||||||
|
TestGameDef();
|
||||||
|
~TestGameDef() = default;
|
||||||
|
|
||||||
|
void defineSomeNodes();
|
||||||
|
|
||||||
|
bool joinModChannel(const std::string &channel);
|
||||||
|
bool leaveModChannel(const std::string &channel);
|
||||||
|
bool sendModChannelMessage(const std::string &channel, const std::string &message);
|
||||||
|
ModChannel *getModChannel(const std::string &channel)
|
||||||
|
{
|
||||||
|
return m_modchannel_mgr->getModChannel(channel);
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::unique_ptr<ModChannelMgr> m_modchannel_mgr;
|
||||||
|
};
|
||||||
|
|
||||||
// A few item and node definitions for those tests that need them
|
// A few item and node definitions for those tests that need them
|
||||||
extern content_t t_CONTENT_STONE;
|
extern content_t t_CONTENT_STONE;
|
||||||
extern content_t t_CONTENT_GRASS;
|
extern content_t t_CONTENT_GRASS;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue