Snake/src/Core/Crawl/ilevel.h

70 lines
1.7 KiB
C
Raw Normal View History

2021-07-03 21:05:03 +03:00
//#
//# Copyright (C) 2021-2021 QuasarApp.
//# Distributed under the GPLv3 software license, see the accompanying
//# Everyone is permitted to copy and distribute verbatim copies
//# of this license document, but changing it is not allowed.
//#
2021-08-11 00:21:22 +03:00
#include <QHash>
2021-07-03 21:05:03 +03:00
#ifndef LEVEL_H
#define LEVEL_H
2021-07-05 17:39:26 +03:00
namespace CRAWL {
2021-07-03 21:05:03 +03:00
class IWorld;
2021-08-11 00:21:22 +03:00
class IItem;
2021-07-03 21:05:03 +03:00
/**
* @brief The ILevel class This interface make the world instance object.
* All levels libraries should be override this interface.
2021-08-11 00:21:22 +03:00
*
2021-07-03 21:05:03 +03:00
*/
class ILevel
{
public:
ILevel() = default;
2021-08-11 00:21:22 +03:00
virtual ~ILevel();
2021-07-03 21:05:03 +03:00
/**
* @brief world This method should be return pointer to the level world.
* @return pointer to the level world.
2021-08-11 00:21:22 +03:00
* @see ILevel::setWorld
*/
IWorld* world();
/**
* @brief previewScane this method should be create a model of the snake preview scane.
* @return pointer to the model of the preview scane.
* @see ILevel::setPreviewScane
*/
IWorld* previewScane();
protected:
/**
* @brief setWorld This method sets new world pointer.
* @param newWorld This is new world model object.
* @note The @a newWorld item will be distroued with the parent object.
* @see ILevel::world
*/
void setWorld(IWorld *newWorld);
/**
* @brief setPreviewScane This method sets new object for the preview scane.
* @param newPreviewScane This is new value of the preview scane.
* @note The @a newPreviewScane item will be distroued with the parent object.
* @see ILevel::previewScane
2021-07-03 21:05:03 +03:00
*/
2021-08-11 00:21:22 +03:00
void setPreviewScane(IWorld *newPreviewScane);
private:
IWorld* _world = nullptr;
IWorld* _previewScane = nullptr;
2021-07-03 21:05:03 +03:00
};
2021-07-05 17:39:26 +03:00
}
2021-07-03 21:05:03 +03:00
#endif // LEVEL_H