Merge branch 'engine' of github.com:QuasarApp/Snake into engine

This commit is contained in:
Andrei Yankovich 2021-06-16 15:47:00 +03:00
commit 8f4043f5df
10 changed files with 21 additions and 15 deletions

View File

@ -2,11 +2,12 @@
#define DEFAULTCONTROL_H #define DEFAULTCONTROL_H
#include "icontrol.h" #include "icontrol.h"
#include "global.h"
/** /**
* @brief The DefaultControl class This class contains default implementation of the game menu. * @brief The DefaultControl class This class contains default implementation of the game menu.
*/ */
class DefaultControl : public IControl { class SNAKEPROJECT_EXPORT DefaultControl : public IControl {
Q_OBJECT Q_OBJECT
public: public:
DefaultControl(); DefaultControl();

View File

@ -11,8 +11,7 @@
/** /**
* @brief The GuiObject class This base model for gui objects. * @brief The GuiObject class This base model for gui objects.
*/ */
class GuiObject: public QObject, public IRender class SNAKEPROJECT_EXPORT GuiObject: public QObject, public IRender {
{
Q_OBJECT Q_OBJECT
Q_PROPERTY(QString color READ color WRITE setColor NOTIFY colorChanged) Q_PROPERTY(QString color READ color WRITE setColor NOTIFY colorChanged)
Q_PROPERTY(int guiId READ guiId NOTIFY guiIdChanged) Q_PROPERTY(int guiId READ guiId NOTIFY guiIdChanged)

View File

@ -1,6 +1,8 @@
#ifndef IAI_H #ifndef IAI_H
#define IAI_H #define IAI_H
#include "global.h"
/** /**
* @brief The IAI class Is default interface for ai classes. * @brief The IAI class Is default interface for ai classes.
* @note example of use : * @note example of use :
@ -11,7 +13,7 @@
* } * }
* ``` * ```
*/ */
class IAI { class SNAKEPROJECT_EXPORT IAI {
public: public:
IAI(); IAI();
virtual ~IAI() = default; virtual ~IAI() = default;

View File

@ -1,6 +1,8 @@
#ifndef ICONTROL_H #ifndef ICONTROL_H
#define ICONTROL_H #define ICONTROL_H
#include <QObject> #include <QObject>
#include "global.h"
/** /**
* @brief The IControl class This interface should be contains implementation of custom user interface * @brief The IControl class This interface should be contains implementation of custom user interface
@ -11,7 +13,7 @@
* For more information see the DefaultControl class. * For more information see the DefaultControl class.
* *
*/ */
class IControl : public QObject { class SNAKEPROJECT_EXPORT IControl : public QObject {
Q_OBJECT Q_OBJECT
Q_PROPERTY(QString view READ view NOTIFY viewChanged) Q_PROPERTY(QString view READ view NOTIFY viewChanged)

View File

@ -2,12 +2,12 @@
#define IGROUND_H #define IGROUND_H
#include "iworlditem.h" #include "iworlditem.h"
#include "global.h"
/** /**
* @brief The IGround class This is one tile of the world. Any objects of this type created automatically for filing ground plain. * @brief The IGround class This is one tile of the world. Any objects of this type created automatically for filing ground plain.
*/ */
class IGround: public IWorldItem class SNAKEPROJECT_EXPORT IGround: public IWorldItem {
{
public: public:
IGround(); IGround();

View File

@ -3,14 +3,14 @@
#include "gameresult.h" #include "gameresult.h"
#include "iworlditem.h" #include "iworlditem.h"
#include "global.h"
class IControl; class IControl;
/** /**
* @brief The IPlayer class This is base class of the player functions. * @brief The IPlayer class This is base class of the player functions.
*/ */
class IPlayer: public IWorldItem class SNAKEPROJECT_EXPORT IPlayer: public IWorldItem {
{
Q_OBJECT Q_OBJECT
public: public:
IPlayer(); IPlayer();

View File

@ -1,13 +1,13 @@
#ifndef IRENDER_H #ifndef IRENDER_H
#define IRENDER_H #define IRENDER_H
#include "global.h"
/** /**
* @brief The IRender class This interface provide render functionality for all objects. * @brief The IRender class This interface provide render functionality for all objects.
* @note Override the render method. * @note Override the render method.
*/ */
class IRender class SNAKEPROJECT_EXPORT IRender {
{
public: public:
IRender(); IRender();

View File

@ -11,6 +11,7 @@
#include <QString> #include <QString>
#include "irender.h" #include "irender.h"
#include "diff.h" #include "diff.h"
#include "global.h"
class IWorldItem; class IWorldItem;
class IPlayer; class IPlayer;
@ -39,7 +40,7 @@ struct WorldObjectWraper {
/** /**
* @brief The IWorld class use this interface for implementation your own game levels * @brief The IWorld class use this interface for implementation your own game levels
*/ */
class IWorld : public QObject, public IRender class SNAKEPROJECT_EXPORT IWorld : public QObject, public IRender
{ {
Q_OBJECT Q_OBJECT
Q_PROPERTY(QVector3D cameraReleativePosition READ cameraReleativePosition NOTIFY cameraReleativePositionChanged) Q_PROPERTY(QVector3D cameraReleativePosition READ cameraReleativePosition NOTIFY cameraReleativePositionChanged)

View File

@ -2,12 +2,13 @@
#define IWORLDITEM_H #define IWORLDITEM_H
#include <SnakeProject/guiobject.h> #include <SnakeProject/guiobject.h>
#include "global.h"
class IWorld; class IWorld;
/** /**
* @brief The IWorldItem class This is World item. This class contains functions for control event system. * @brief The IWorldItem class This is World item. This class contains functions for control event system.
*/ */
class IWorldItem: public GuiObject { class SNAKEPROJECT_EXPORT IWorldItem: public GuiObject {
Q_OBJECT Q_OBJECT
public: public:
IWorldItem(); IWorldItem();

View File

@ -17,7 +17,7 @@ IWorld* PluginLoader::load(const QString &pluginPath) {
QuasarAppUtils::Params::log("Fail to load game module. Message: " + lib.errorString(), QuasarAppUtils::Params::log("Fail to load game module. Message: " + lib.errorString(),
QuasarAppUtils::Error); QuasarAppUtils::Error);
return {}; return nullptr;
} }
worldInstance worldFunc = (worldInstance)lib.resolve("worldInstance"); worldInstance worldFunc = (worldInstance)lib.resolve("worldInstance");
@ -28,7 +28,7 @@ IWorld* PluginLoader::load(const QString &pluginPath) {
QuasarAppUtils::Error); QuasarAppUtils::Error);
lib.unload(); lib.unload();
return {}; return nullptr;
} }
return worldFunc(); return worldFunc();