diff --git a/src/Client/main.cpp b/src/Client/main.cpp index ce1d549..11d0e25 100644 --- a/src/Client/main.cpp +++ b/src/Client/main.cpp @@ -20,7 +20,7 @@ int main(int argc, char *argv[]) QGuiApplication app(argc, argv); QQmlApplicationEngine engine; - ClientApp client; + CRAWL::ClientApp client; client.registerLevel<TestLvl>(); diff --git a/src/Core/Crawl/clasteritem.cpp b/src/Core/Crawl/clasteritem.cpp index 50b4dd1..21225ed 100644 --- a/src/Core/Crawl/clasteritem.cpp +++ b/src/Core/Crawl/clasteritem.cpp @@ -8,6 +8,9 @@ #include "Extensions/claster.h" #include "clasteritem.h" +namespace CRAWL { + + ClasterItem::ClasterItem(const QString &name, const QString &viewTempalte, QObject *ptr): @@ -36,3 +39,5 @@ void ClasterItem::removeClaster(Claster *claster) { const QSet<Claster *> &ClasterItem::parentClasters() const { return _parentClasters; } + +} diff --git a/src/Core/Crawl/clasteritem.h b/src/Core/Crawl/clasteritem.h index 503b1c4..70ea6f5 100644 --- a/src/Core/Crawl/clasteritem.h +++ b/src/Core/Crawl/clasteritem.h @@ -13,6 +13,8 @@ #ifndef CLASTERITEM_H #define CLASTERITEM_H +namespace CRAWL { + class Claster; /** @@ -59,4 +61,5 @@ private: friend class Claster; }; +} #endif // CLASTERITEM_H diff --git a/src/Core/Crawl/clientapp.cpp b/src/Core/Crawl/clientapp.cpp index 282ce03..538c82c 100644 --- a/src/Core/Crawl/clientapp.cpp +++ b/src/Core/Crawl/clientapp.cpp @@ -23,6 +23,8 @@ #include <viewsolutions.h> #include "worldstatus.h" +namespace CRAWL { + QByteArray ClientApp::initTheme() { int themeIndex = Settings::instance()->getValue(THEME, THEME_DEFAULT).toInt(); @@ -149,3 +151,5 @@ void ClientApp::addLvl(IWorld *levelWordl) { _availableLvls.insert(data.model->name(), data); _menu->addWorldViewModel(data.viewModel); } + +} diff --git a/src/Core/Crawl/clientapp.h b/src/Core/Crawl/clientapp.h index f6df3c1..95a07b8 100644 --- a/src/Core/Crawl/clientapp.h +++ b/src/Core/Crawl/clientapp.h @@ -14,15 +14,18 @@ #include "global.h" #include "ilevel.h" +class QQmlApplicationEngine; +inline void initCrawlResources() { Q_INIT_RESOURCE(Crawl); } + +namespace CRAWL { + + class Engine; class IWorld; class WorldViewData; -class QQmlApplicationEngine; class MainMenuModel; class IControl; -inline void initCrawlResources() { Q_INIT_RESOURCE(Crawl); } - /** * @brief The WordlData struct simple structure that contains information about world. @@ -32,7 +35,6 @@ struct WordlData { IWorld * model = nullptr; }; - /** * @brief The ClientApp class This is main class of the Game engine. */ @@ -85,4 +87,6 @@ private: Engine *_engine = nullptr; }; +} + #endif // CLIENTAPP_H diff --git a/src/Core/Crawl/defaultcontrol.cpp b/src/Core/Crawl/defaultcontrol.cpp index 2d6bf78..e99e3d8 100644 --- a/src/Core/Crawl/defaultcontrol.cpp +++ b/src/Core/Crawl/defaultcontrol.cpp @@ -7,6 +7,8 @@ #include "defaultcontrol.h" +namespace CRAWL { + DefaultControl::DefaultControl() { } @@ -14,3 +16,4 @@ DefaultControl::DefaultControl() { QString DefaultControl::initQmlView() const { return "qrc:/CrawlModule/DefaultMenu.qml"; } +} diff --git a/src/Core/Crawl/defaultcontrol.h b/src/Core/Crawl/defaultcontrol.h index 68342ae..249176d 100644 --- a/src/Core/Crawl/defaultcontrol.h +++ b/src/Core/Crawl/defaultcontrol.h @@ -11,6 +11,9 @@ #include "icontrol.h" #include "global.h" +namespace CRAWL { + + /** * @brief The DefaultControl class This class contains default implementation of the game menu. */ @@ -37,4 +40,6 @@ signals: void userTap(); }; +} + #endif // DEFAULTCONTROL_H diff --git a/src/Core/Crawl/diff.cpp b/src/Core/Crawl/diff.cpp index 6a265c4..1bba0e6 100644 --- a/src/Core/Crawl/diff.cpp +++ b/src/Core/Crawl/diff.cpp @@ -1,5 +1,7 @@ #include "diff.h" +namespace CRAWL { + QList<int> Diff::getAddedIds() const { return addedIds; } @@ -8,3 +10,4 @@ QList<int> Diff::getRemoveIds() const { return removeIds; } +} diff --git a/src/Core/Crawl/diff.h b/src/Core/Crawl/diff.h index ce8a538..3d10a94 100644 --- a/src/Core/Crawl/diff.h +++ b/src/Core/Crawl/diff.h @@ -11,6 +11,8 @@ #include <QList> #include <QObject> +namespace CRAWL { + class GuiObject; /** @@ -27,6 +29,7 @@ public: QList<int> addedIds; }; -Q_DECLARE_METATYPE(Diff) +} +Q_DECLARE_METATYPE(CRAWL::Diff) #endif // DIFF_H diff --git a/src/Core/Crawl/gameresult.h b/src/Core/Crawl/gameresult.h index ab1c7a3..21930e2 100644 --- a/src/Core/Crawl/gameresult.h +++ b/src/Core/Crawl/gameresult.h @@ -8,6 +8,8 @@ #ifndef GAMERESULT_H #define GAMERESULT_H +namespace CRAWL { + /** * @brief The GameResult struct This is simple structure with game statistic. */ @@ -24,4 +26,6 @@ struct GameResult int distance = 0; }; +} + #endif // GAMERESULT_H diff --git a/src/Core/Crawl/guiobject.cpp b/src/Core/Crawl/guiobject.cpp index 2ab3e22..efab7f8 100644 --- a/src/Core/Crawl/guiobject.cpp +++ b/src/Core/Crawl/guiobject.cpp @@ -9,6 +9,9 @@ #include <QVector3D> +namespace CRAWL { + + GuiObject::GuiObject(const QString &name, const QString &viewTempalte, QObject *ptr): QObject (ptr) { _viewTemplate = viewTempalte; @@ -180,3 +183,5 @@ void GuiObject::setMash(const QString &newMash) { _mash = newMash; emit mashChanged(); } + +} diff --git a/src/Core/Crawl/guiobject.h b/src/Core/Crawl/guiobject.h index 25d7127..3558842 100644 --- a/src/Core/Crawl/guiobject.h +++ b/src/Core/Crawl/guiobject.h @@ -17,6 +17,9 @@ #define DEFAULT_VIEW_TEMPLATE "qrc:/CrawlModule/GraphicItem.qml" +namespace CRAWL { + + /** * @brief The GuiObject class This base model for gui objects. * @@ -162,7 +165,6 @@ protected: int _guiId = -1; QString _color = "#ff1111"; - private: void generateId(); @@ -179,4 +181,5 @@ private: QString _className; }; +} #endif // GUIOBJECT_H diff --git a/src/Core/Crawl/iai.cpp b/src/Core/Crawl/iai.cpp index 083dd73..33aa30f 100644 --- a/src/Core/Crawl/iai.cpp +++ b/src/Core/Crawl/iai.cpp @@ -7,6 +7,10 @@ #include "iai.h" +namespace CRAWL { + IAI::IAI() { } + +} diff --git a/src/Core/Crawl/iai.h b/src/Core/Crawl/iai.h index 1645ed8..5c61f9f 100644 --- a/src/Core/Crawl/iai.h +++ b/src/Core/Crawl/iai.h @@ -10,6 +10,8 @@ #include "global.h" +namespace CRAWL { + /** * @brief The IAI class Is default interface for ai classes. * @note example of use : @@ -36,4 +38,5 @@ public: virtual void stopAI() = 0; }; +} #endif // IAI_H diff --git a/src/Core/Crawl/icontrol.cpp b/src/Core/Crawl/icontrol.cpp index 35868d0..dcbe3ab 100644 --- a/src/Core/Crawl/icontrol.cpp +++ b/src/Core/Crawl/icontrol.cpp @@ -7,6 +7,9 @@ #include "icontrol.h" +namespace CRAWL { + + IControl::IControl() { } @@ -30,3 +33,5 @@ void IControl::setView(const QString &newView) { _view = newView; emit viewChanged(); } + +} diff --git a/src/Core/Crawl/icontrol.h b/src/Core/Crawl/icontrol.h index 94472a9..edc2c03 100644 --- a/src/Core/Crawl/icontrol.h +++ b/src/Core/Crawl/icontrol.h @@ -11,6 +11,9 @@ #include <QObject> #include "global.h" +namespace CRAWL { + + /** * @brief The IControl class This interface should be contains implementation of custom user interface * How to use this class: @@ -62,4 +65,6 @@ private: friend class Engine; }; +} + #endif // ICONTROL_H diff --git a/src/Core/Crawl/iground.cpp b/src/Core/Crawl/iground.cpp index 3a97c55..02295d0 100644 --- a/src/Core/Crawl/iground.cpp +++ b/src/Core/Crawl/iground.cpp @@ -8,6 +8,9 @@ #include "iground.h" #include "iworld.h" +namespace CRAWL { + + IGround::IGround(const QString &name, const QString &viewTempalte, QObject *ptr): @@ -24,3 +27,5 @@ void IGround::render(unsigned int ) { setX(playerObject->position().x() + camera.z() * 4); } } + +} diff --git a/src/Core/Crawl/iground.h b/src/Core/Crawl/iground.h index 8dbd4b0..f207efd 100644 --- a/src/Core/Crawl/iground.h +++ b/src/Core/Crawl/iground.h @@ -11,6 +11,8 @@ #include "iworlditem.h" #include "global.h" +namespace CRAWL { + /** * @brief The IGround class This is one tile of the world. Any objects of this type created automatically for filing ground plain. */ @@ -25,4 +27,6 @@ public: void render(unsigned int tbfMsec) override; }; +} + #endif // IGROUND_H diff --git a/src/Core/Crawl/ilevel.h b/src/Core/Crawl/ilevel.h index f9b1dc5..5cad4c6 100644 --- a/src/Core/Crawl/ilevel.h +++ b/src/Core/Crawl/ilevel.h @@ -8,6 +8,9 @@ #ifndef LEVEL_H #define LEVEL_H +namespace CRAWL { + + class IWorld; /** @@ -27,4 +30,6 @@ public: virtual IWorld* world() = 0; }; +} + #endif // LEVEL_H diff --git a/src/Core/Crawl/iplayer.cpp b/src/Core/Crawl/iplayer.cpp index a7b7752..ed9f5ff 100644 --- a/src/Core/Crawl/iplayer.cpp +++ b/src/Core/Crawl/iplayer.cpp @@ -8,6 +8,9 @@ #include "defaultcontrol.h" #include "iplayer.h" +namespace CRAWL { + + IPlayer::IPlayer(const QString &name, const QString &viewTempalte, QObject *ptr): @@ -53,3 +56,5 @@ void IPlayer::setControl(const IControl *control) { void IPlayer::kill() { _fDead = true; } + +} diff --git a/src/Core/Crawl/iplayer.h b/src/Core/Crawl/iplayer.h index 61f8b3c..76f7a97 100644 --- a/src/Core/Crawl/iplayer.h +++ b/src/Core/Crawl/iplayer.h @@ -13,6 +13,9 @@ #include "iworlditem.h" #include "Extensions/movableobject.h" +namespace CRAWL { + + class IControl; /** @@ -83,4 +86,6 @@ private: }; +} + #endif // IPLAYER_H diff --git a/src/Core/Crawl/irender.cpp b/src/Core/Crawl/irender.cpp index f25260f..2b30996 100644 --- a/src/Core/Crawl/irender.cpp +++ b/src/Core/Crawl/irender.cpp @@ -6,8 +6,10 @@ //# #include "irender.h" +namespace CRAWL { IRender::IRender() { } +} diff --git a/src/Core/Crawl/irender.h b/src/Core/Crawl/irender.h index e468370..a8d35a6 100644 --- a/src/Core/Crawl/irender.h +++ b/src/Core/Crawl/irender.h @@ -11,6 +11,8 @@ #include "global.h" #include "quasarapp.h" +namespace CRAWL { + /** * @brief The IRender class This interface provide render functionality for all objects. * @note Override the render method. @@ -57,4 +59,5 @@ public: }; }; +} #endif // IRENDER_H diff --git a/src/Core/Crawl/iworld.cpp b/src/Core/Crawl/iworld.cpp index 09c8d7d..1eaea2e 100644 --- a/src/Core/Crawl/iworld.cpp +++ b/src/Core/Crawl/iworld.cpp @@ -18,6 +18,10 @@ #include "clasteritem.h" #include "thread" #include "chrono" +#include "diff.h" + +namespace CRAWL { + IWorld::IWorld() { @@ -419,3 +423,5 @@ void IWorld::runAsBackGround() { setTargetFps(30); } + +} diff --git a/src/Core/Crawl/iworld.h b/src/Core/Crawl/iworld.h index 2eb1dfd..5d323d9 100644 --- a/src/Core/Crawl/iworld.h +++ b/src/Core/Crawl/iworld.h @@ -17,9 +17,13 @@ #include <QQuaternion> #include <QString> #include "irender.h" -#include "diff.h" #include "global.h" #include <QMutex> +#include "Crawl/diff.h" + +class ClastersTest; + +namespace CRAWL { class IWorldItem; class IPlayer; @@ -239,7 +243,7 @@ signals: * @brief sigOBjctsListChanged This signal emited when lvel status are changed. * @brief diff This is list of removed and addeds items */ - void sigOBjctsListChanged(Diff diff); + void sigOBjctsListChanged(CRAWL::Diff diff); /** * @brief cameraReleativePositionChanged This signal emot when releative position of camera cahged. @@ -472,7 +476,8 @@ private: friend class Engine; // testing - friend class ClastersTest; + friend ClastersTest; }; +} #endif // IWORLD_H diff --git a/src/Core/Crawl/iworlditem.cpp b/src/Core/Crawl/iworlditem.cpp index a0a49d7..05e2c98 100644 --- a/src/Core/Crawl/iworlditem.cpp +++ b/src/Core/Crawl/iworlditem.cpp @@ -9,6 +9,9 @@ #include "iworld.h" #include "quasarapp.h" +namespace CRAWL { + + IWorldItem::IWorldItem(const QString& name, const QString& viewTempalte, QObject *ptr): @@ -56,3 +59,5 @@ void IWorldItem::initOnWorld(const IWorld *world, const IWorldItem * player) { const IWorld *IWorldItem::world() const { return _world; } + +} diff --git a/src/Core/Crawl/iworlditem.h b/src/Core/Crawl/iworlditem.h index 3459237..0e2c9c9 100644 --- a/src/Core/Crawl/iworlditem.h +++ b/src/Core/Crawl/iworlditem.h @@ -11,6 +11,9 @@ #include <Crawl/guiobject.h> #include "global.h" +namespace CRAWL { + + class IWorld; /** * @brief The IWorldItem class This is World item. This class contains functions for control event system. @@ -62,5 +65,5 @@ private: const IWorldItem *_playerObject = nullptr; friend class IWorld; }; - +} #endif // IWORLDITEM_H diff --git a/src/Core/Crawl/singleclasterworlditem.cpp b/src/Core/Crawl/singleclasterworlditem.cpp index 46769fb..6e2f22f 100644 --- a/src/Core/Crawl/singleclasterworlditem.cpp +++ b/src/Core/Crawl/singleclasterworlditem.cpp @@ -10,6 +10,9 @@ #include "singleclasterworlditem.h" #include "quasarapp.h" +namespace CRAWL { + + SingleClasterWorldItem::SingleClasterWorldItem(const QString &name, const QString &viewTempalte, QObject *ptr): @@ -34,3 +37,5 @@ Claster *SingleClasterWorldItem::parentClaster() const { return *ClasterItem::parentClasters().begin(); } + +} diff --git a/src/Core/Crawl/singleclasterworlditem.h b/src/Core/Crawl/singleclasterworlditem.h index cd9969f..1a05d72 100644 --- a/src/Core/Crawl/singleclasterworlditem.h +++ b/src/Core/Crawl/singleclasterworlditem.h @@ -11,6 +11,8 @@ #include "clasteritem.h" +namespace CRAWL { + class Claster; /** @@ -41,5 +43,6 @@ protected: friend class Claster; }; +} #endif // SINGLECLASTERWORLDITEM_H diff --git a/src/Core/Crawl/snake.cpp b/src/Core/Crawl/snake.cpp index 9ac0996..fca973a 100644 --- a/src/Core/Crawl/snake.cpp +++ b/src/Core/Crawl/snake.cpp @@ -12,6 +12,9 @@ #include <quasarapp.h> #include <cmath> +namespace CRAWL { + + Snake::Snake(const QString &name, const QString &viewTempalte, QObject *ptr): IPlayer (name, viewTempalte, ptr) { @@ -159,3 +162,5 @@ float Snake::lengthBetwinItems() const{ void Snake::setLengthBetwinItems(float newLengthBetwinItems) { _lengthBetwinItems = newLengthBetwinItems; } + +} diff --git a/src/Core/Crawl/snake.h b/src/Core/Crawl/snake.h index 3823c53..706f8e2 100644 --- a/src/Core/Crawl/snake.h +++ b/src/Core/Crawl/snake.h @@ -11,6 +11,8 @@ #include "iplayer.h" #include "Extensions/claster.h" +namespace CRAWL { + class SnakeItem; /** @@ -118,4 +120,6 @@ private: }; +} + #endif // SNAKE_H diff --git a/src/Core/Crawl/snakeitem.cpp b/src/Core/Crawl/snakeitem.cpp index a94d1a8..b7d0786 100644 --- a/src/Core/Crawl/snakeitem.cpp +++ b/src/Core/Crawl/snakeitem.cpp @@ -8,6 +8,9 @@ #include "snake.h" #include "snakeitem.h" +namespace CRAWL { + + SnakeItem::SnakeItem(const QString itemName): SingleClasterWorldItem(itemName) { setAngularVelocity(-1); @@ -41,3 +44,4 @@ void SnakeItem::render(unsigned int tbfMsec) { const IWorldItem * SnakeItem::prev() const { return _prevObject; } +} diff --git a/src/Core/Crawl/snakeitem.h b/src/Core/Crawl/snakeitem.h index 23c20ff..329b534 100644 --- a/src/Core/Crawl/snakeitem.h +++ b/src/Core/Crawl/snakeitem.h @@ -12,6 +12,9 @@ #include "singleclasterworlditem.h" #include "Extensions/movableobject.h" +namespace CRAWL { + + class CRAWL_EXPORT SnakeItem: public SingleClasterWorldItem, public MovableObject { Q_OBJECT @@ -35,4 +38,6 @@ private: const IWorldItem *_prevObject = nullptr; }; +} + #endif // SNAKEITEM_H diff --git a/src/Core/CrawlModule/Scene.qml b/src/Core/CrawlModule/Scene.qml index 4ea123a..60429a1 100644 --- a/src/Core/CrawlModule/Scene.qml +++ b/src/Core/CrawlModule/Scene.qml @@ -98,7 +98,7 @@ View3D { target: privateRoot.world; function onSigOBjctsListChanged(diff) { if (!diff) { - console.log("dif not found"); + console.log("diff not found"); return; } diff --git a/src/Core/CrawlModule/SettingsView.qml b/src/Core/CrawlModule/SettingsView.qml index 2d74c4e..491ed18 100644 --- a/src/Core/CrawlModule/SettingsView.qml +++ b/src/Core/CrawlModule/SettingsView.qml @@ -69,7 +69,6 @@ Item { themeWarning.visible = true; } } - } Item { diff --git a/src/Core/Extensions/claster.cpp b/src/Core/Extensions/claster.cpp index 75ede55..8ce6988 100644 --- a/src/Core/Extensions/claster.cpp +++ b/src/Core/Extensions/claster.cpp @@ -8,6 +8,8 @@ #include "claster.h" #include "Crawl/singleclasterworlditem.h" +namespace CRAWL { + Claster::Claster() {} Claster::~Claster() { @@ -34,3 +36,5 @@ void Claster::remove(int id) { const QHash<int, ClasterItem *> &Claster::objects() const { return _objects; } + +} diff --git a/src/Core/Extensions/claster.h b/src/Core/Extensions/claster.h index dcfac7d..4a1f1e3 100644 --- a/src/Core/Extensions/claster.h +++ b/src/Core/Extensions/claster.h @@ -10,6 +10,9 @@ #include "Crawl/iworlditem.h" +namespace CRAWL { + + class ClasterItem; /** @@ -54,4 +57,5 @@ private: }; +} #endif // CLASTER_H diff --git a/src/Core/Extensions/movableobject.cpp b/src/Core/Extensions/movableobject.cpp index 087b8ec..2dd0844 100644 --- a/src/Core/Extensions/movableobject.cpp +++ b/src/Core/Extensions/movableobject.cpp @@ -10,6 +10,9 @@ #include <math.h> #include <Crawl/guiobject.h> +namespace CRAWL { + + MovableObject::MovableObject() { } @@ -87,3 +90,5 @@ void MovableObject::renderPosition(GuiObject *object, unsigned int tbfMsec) { const QVector3D &MovableObject::currentMovableVector() const { return _currentMovableVector; } + +} diff --git a/src/Core/Extensions/movableobject.h b/src/Core/Extensions/movableobject.h index 6cb5a85..fad0ed2 100644 --- a/src/Core/Extensions/movableobject.h +++ b/src/Core/Extensions/movableobject.h @@ -12,6 +12,9 @@ #include "Crawl/irender.h" #include <QVector3D> +namespace CRAWL { + + class GuiObject; /** @@ -106,4 +109,6 @@ private: float _breakingForce = 0; }; +} + #endif // MOVABLEOBJECT_H diff --git a/src/Core/private/defaultbackgroundai.cpp b/src/Core/private/defaultbackgroundai.cpp index 9c7e998..eaf7980 100644 --- a/src/Core/private/defaultbackgroundai.cpp +++ b/src/Core/private/defaultbackgroundai.cpp @@ -8,6 +8,8 @@ #include "defaultbackgroundai.h" #include <QTimer> +namespace CRAWL { + DefaultBackgroundAI::DefaultBackgroundAI() { _timer = new QTimer(); _timer->setInterval(1000); @@ -33,3 +35,5 @@ void DefaultBackgroundAI::handleTimerTriger() { emit userTap(); } + +} diff --git a/src/Core/private/defaultbackgroundai.h b/src/Core/private/defaultbackgroundai.h index a86d9c0..e4dc8eb 100644 --- a/src/Core/private/defaultbackgroundai.h +++ b/src/Core/private/defaultbackgroundai.h @@ -10,9 +10,10 @@ #include "Crawl/defaultcontrol.h" #include <Crawl/iai.h> - class QTimer; +namespace CRAWL { + class DefaultBackgroundAI: public DefaultControl, public IAI { Q_OBJECT public: @@ -31,4 +32,5 @@ private: QTimer *_timer = nullptr; }; +} #endif // DEFAULTBACKGROUNDAI_H diff --git a/src/Core/private/engine.cpp b/src/Core/private/engine.cpp index cdbc819..5944d53 100644 --- a/src/Core/private/engine.cpp +++ b/src/Core/private/engine.cpp @@ -16,6 +16,8 @@ #include "QDateTime" #include "QtConcurrent" +namespace CRAWL { + Engine::Engine(QObject *parent): QObject(parent) { } @@ -170,3 +172,5 @@ void Engine::renderLoop() { } + +} diff --git a/src/Core/private/engine.h b/src/Core/private/engine.h index b4cc171..c27a114 100644 --- a/src/Core/private/engine.h +++ b/src/Core/private/engine.h @@ -13,6 +13,8 @@ #include <QQmlEngine> #include <Crawl/diff.h> +namespace CRAWL { + class IWorld; /** @@ -148,4 +150,5 @@ private: bool _renderLoop = false; }; +} #endif // ENGINE_H diff --git a/src/Core/private/mainmenumodel.cpp b/src/Core/private/mainmenumodel.cpp index 5b01103..6426c36 100644 --- a/src/Core/private/mainmenumodel.cpp +++ b/src/Core/private/mainmenumodel.cpp @@ -11,6 +11,8 @@ #include <quasarapp.h> +namespace CRAWL { + MainMenuModel::MainMenuModel(QObject *ptr): QObject (ptr) { _conf = QuasarAppUtils::Settings::instance(); @@ -39,3 +41,4 @@ void MainMenuModel::newGame(const QString &lvl) { emit sigNewGame(lvl); } +} diff --git a/src/Core/private/mainmenumodel.h b/src/Core/private/mainmenumodel.h index 6f7a27d..4428fcb 100644 --- a/src/Core/private/mainmenumodel.h +++ b/src/Core/private/mainmenumodel.h @@ -16,6 +16,8 @@ namespace ViewSolutions { class ListViewModel; } +namespace CRAWL { + class WorldInfo; /** @@ -49,4 +51,5 @@ private: }; +} #endif // NETWORKPROFILEMAINMODEL_H diff --git a/src/Core/private/worldviewdata.cpp b/src/Core/private/worldviewdata.cpp index f70facb..dba250b 100644 --- a/src/Core/private/worldviewdata.cpp +++ b/src/Core/private/worldviewdata.cpp @@ -7,6 +7,7 @@ #include "worldviewdata.h" #include "Crawl/iworld.h" +namespace CRAWL { WorldViewData::WorldViewData(const IWorld *data) { setWorldObject(data); @@ -63,3 +64,4 @@ void WorldViewData::setWorldObject(const IWorld *newWorldObject) { emit dataChanged(); } +} diff --git a/src/Core/private/worldviewdata.h b/src/Core/private/worldviewdata.h index 7673bbd..97c8232 100644 --- a/src/Core/private/worldviewdata.h +++ b/src/Core/private/worldviewdata.h @@ -10,6 +10,8 @@ #include <QObject> +namespace CRAWL { + class IWorld; /** @@ -46,5 +48,5 @@ signals: void dataChanged(); void unlockedChanged(); }; - +} #endif // WORLDVIEWDATA_H diff --git a/src/CrawlTestLvl/private/box.h b/src/CrawlTestLvl/private/box.h index c6a86c5..8ebe262 100644 --- a/src/CrawlTestLvl/private/box.h +++ b/src/CrawlTestLvl/private/box.h @@ -9,7 +9,7 @@ #define BOX_H #include "Crawl/iworlditem.h" -class Box: public IWorldItem { +class Box: public CRAWL::IWorldItem { public: Box(); diff --git a/src/CrawlTestLvl/private/plate.h b/src/CrawlTestLvl/private/plate.h index 9d40c89..13a4c0c 100644 --- a/src/CrawlTestLvl/private/plate.h +++ b/src/CrawlTestLvl/private/plate.h @@ -9,7 +9,7 @@ #define PLATE_H #include "Crawl/iground.h" -class Plate: public IGround { +class Plate: public CRAWL::IGround { public: Plate(); diff --git a/src/CrawlTestLvl/private/testcontrol.h b/src/CrawlTestLvl/private/testcontrol.h index bf349bb..b5c077d 100644 --- a/src/CrawlTestLvl/private/testcontrol.h +++ b/src/CrawlTestLvl/private/testcontrol.h @@ -5,7 +5,7 @@ /** * @brief The TestControl class This controll support custom camera-ratation functions. */ -class TestControl: public DefaultControl +class TestControl: public CRAWL::DefaultControl { Q_OBJECT public: diff --git a/src/CrawlTestLvl/private/testsnake.h b/src/CrawlTestLvl/private/testsnake.h index 9429654..9f89930 100644 --- a/src/CrawlTestLvl/private/testsnake.h +++ b/src/CrawlTestLvl/private/testsnake.h @@ -10,7 +10,7 @@ #include "Crawl/snake.h" -class TestSnake : public Snake { +class TestSnake : public CRAWL::Snake { Q_OBJECT diff --git a/src/CrawlTestLvl/private/testsnakeitem.h b/src/CrawlTestLvl/private/testsnakeitem.h index 54656db..2259833 100644 --- a/src/CrawlTestLvl/private/testsnakeitem.h +++ b/src/CrawlTestLvl/private/testsnakeitem.h @@ -11,7 +11,7 @@ #include "Crawl/snakeitem.h" -class TestSnakeItem: public SnakeItem +class TestSnakeItem: public CRAWL::SnakeItem { Q_OBJECT public: diff --git a/src/CrawlTestLvl/private/world.cpp b/src/CrawlTestLvl/private/world.cpp index 353c10f..85fcd64 100644 --- a/src/CrawlTestLvl/private/world.cpp +++ b/src/CrawlTestLvl/private/world.cpp @@ -17,8 +17,8 @@ World::World() { setCameraRatation(QQuaternion::fromEulerAngles({0,0,-90})); } -WorldRule *World::initWorldRules() { - return new WorldRule { +CRAWL::WorldRule *World::initWorldRules() { + return new CRAWL::WorldRule { {0, {{registerObject<Box>(), 1000}}} }; } @@ -43,11 +43,11 @@ int World::costToUnlock() const { return 0; } -IControl *World::initUserInterface() const { +CRAWL::IControl *World::initUserInterface() const { return new TestControl(); } -void World::initPlayerControl(IControl *control) { +void World::initPlayerControl(CRAWL::IControl *control) { if (auto test = dynamic_cast<TestControl*>(control)) { connect(test, &TestControl::xChanged, this, &World::handleXViewChanged); connect(test, &TestControl::yChanged, this, &World::handleYViewChanged); @@ -56,11 +56,11 @@ void World::initPlayerControl(IControl *control) { return IWorld::initPlayerControl(control); } -IPlayer *World::initPlayer() const { +CRAWL::IPlayer *World::initPlayer() const { return new TestSnake(); } -IAI *World::initBackGroundAI() const { +CRAWL::IAI *World::initBackGroundAI() const { return IWorld::initBackGroundAI(); } diff --git a/src/CrawlTestLvl/private/world.h b/src/CrawlTestLvl/private/world.h index d1a31ef..9bdc679 100644 --- a/src/CrawlTestLvl/private/world.h +++ b/src/CrawlTestLvl/private/world.h @@ -10,23 +10,23 @@ #include "Crawl/iworld.h" -class World : public IWorld { +class World : public CRAWL::IWorld { // IWorld interface public: World(); - WorldRule *initWorldRules() override; + CRAWL::WorldRule *initWorldRules() override; QString initHdrBackGround() const override; QString description() const override; QString imagePreview() const override; QString name() const override; int costToUnlock() const override; - IControl *initUserInterface() const override; - void initPlayerControl(IControl *control) override; - IPlayer *initPlayer() const override; - IAI *initBackGroundAI() const override; + CRAWL::IControl *initUserInterface() const override; + void initPlayerControl(CRAWL::IControl *control) override; + CRAWL::IPlayer *initPlayer() const override; + CRAWL::IAI *initBackGroundAI() const override; private slots: void handleXViewChanged(double dx); diff --git a/src/CrawlTestLvl/testlvl.cpp b/src/CrawlTestLvl/testlvl.cpp index b4afb85..afc75fb 100644 --- a/src/CrawlTestLvl/testlvl.cpp +++ b/src/CrawlTestLvl/testlvl.cpp @@ -12,7 +12,7 @@ TestLvl::TestLvl() { } -IWorld *TestLvl::world() { +CRAWL::IWorld *TestLvl::world() { initTestLvlResources(); return new World(); } diff --git a/src/CrawlTestLvl/testlvl.h b/src/CrawlTestLvl/testlvl.h index eebf1ae..e13d0c6 100644 --- a/src/CrawlTestLvl/testlvl.h +++ b/src/CrawlTestLvl/testlvl.h @@ -17,14 +17,14 @@ inline void initTestLvlResources() { Q_INIT_RESOURCE(Empty); /** * @brief The TestLvl class This is test lvlv wraper of the crawl */ -class CRAWL_TEST_LEVEL_EXPORT TestLvl: public ILevel +class CRAWL_TEST_LEVEL_EXPORT TestLvl: public CRAWL::ILevel { public: TestLvl(); // ILevel interface public: - IWorld *world() override; + CRAWL::IWorld *world() override; }; #endif // TESTLVL_H diff --git a/tests/units/clasterstest.cpp b/tests/units/clasterstest.cpp index 7a39ad5..f48f62a 100644 --- a/tests/units/clasterstest.cpp +++ b/tests/units/clasterstest.cpp @@ -13,7 +13,8 @@ #include <Crawl/iworld.h> // Test claster object. -class TestClasterObject: public IWorldItem, public Claster { +class TestClasterObject: public CRAWL::IWorldItem, + public CRAWL::Claster { public: TestClasterObject(): IWorldItem("TestClaster"){}; @@ -22,7 +23,7 @@ protected: }; // Test single claster item -class TestClasterSingleItem: public SingleClasterWorldItem { +class TestClasterSingleItem: public CRAWL::SingleClasterWorldItem { public: TestClasterSingleItem(): SingleClasterWorldItem("TestClasterSingleItem"){}; protected: @@ -30,7 +31,7 @@ protected: }; // Test claster item -class TestClasterItem: public ClasterItem { +class TestClasterItem: public CRAWL::ClasterItem { public: TestClasterItem(): ClasterItem("TestClasterItem"){}; protected: @@ -38,14 +39,14 @@ protected: }; // Test world of clasters -class TestWorld: public IWorld { +class TestWorld: public CRAWL::IWorld { public: TestWorld(): IWorld(){}; // IWorld interface public: - IPlayer *initPlayer() const {return nullptr;}; - WorldRule *initWorldRules() {return nullptr;}; + CRAWL::IPlayer *initPlayer() const {return nullptr;}; + CRAWL::WorldRule *initWorldRules() {return nullptr;}; QString initHdrBackGround() const {return "";}; QString description() const {return "";}; QString imagePreview() const {return "";};