minimal fixes of syntax errors

This commit is contained in:
Andrei Yankovich 2023-08-27 12:31:43 +02:00
parent 03e1259a37
commit f6d3add90d
24 changed files with 81 additions and 80 deletions

@ -22,8 +22,8 @@ set(PRIVATE_INCUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/private")
add_library(${CURRENT_PROJECT} ${SOURCE_CPP} )
find_package(Qt6 COMPONENTS Quick REQUIRED)
target_link_libraries(${CURRENT_PROJECT} PUBLIC Qt6::Core Qt6::Quick QuasarApp)
find_package(Qt6 COMPONENTS Quick Concurrent REQUIRED)
target_link_libraries(${CURRENT_PROJECT} PUBLIC Qt6::Core Qt6::Quick Qt6::Concurrent QuasarApp)
target_include_directories(${CURRENT_PROJECT} PUBLIC ${PUBLIC_INCUDE_DIR})

@ -14,7 +14,6 @@
#include <QThread>
#include <quasarapp.h>
#include "QDateTime"
#include "QtConcurrent"
#include "store.h"
namespace ButterflyEngine {
@ -131,9 +130,10 @@ void Engine::stop() const {
}
void Engine::handleUnlockedItem(int item) {
_store->buy(*_currentUser, item);
}
void Engine::handleDroppedItem(int item) {
void Engine::handleDroppedItem(int ) {
}
void Engine::handleUnlockedItemsListChanged(const QSet<int> &newSet) {

@ -9,8 +9,10 @@
#include <QDateTime>
#include <thread>
#include <QtConcurrent>
#include <ButterflyEngine/interfaces/iworlditem.h>
#include <ButterflyEngine/interfaces/iworld.h>
namespace ButterflyEngine {
@ -18,7 +20,7 @@ EventServer::EventServer(IWorld *instance) {
debug_assert(instance, "Invalid World pointer in EventServer");
_worldInstance = instance;
_supportedEventsKeys = {Events::Intersects};
_supportedGameEventsKeys = {GameEvents::Intersects};
}
EventServer::~EventServer() {
@ -46,28 +48,28 @@ void EventServer::handleAvailableObjectChanges(const Diff &diff) {
continue;
}
for (int event: qAsConst(_supportedEventsKeys)) {
addToSupportedEvents(obj, event);
for (int event: qAsConst(_supportedGameEventsKeys)) {
addToSupportedGameEvents(obj, event);
}
_objects.insert(obj->guiId(), obj);
}
for (int removed: diff.removeIds) {
for (int event: qAsConst(_supportedEventsKeys)) {
_supportedEvents[event].remove(removed);
for (int event: qAsConst(_supportedGameEventsKeys)) {
_supportedGameEvents[event].remove(removed);
}
_objects.remove(removed);
}
}
void EventServer::eventProcess() {
for (auto it = _supportedEvents.begin(); it != _supportedEvents.end(); ++it) {
for (auto it = _supportedGameEvents.begin(); it != _supportedGameEvents.end(); ++it) {
for (const IWorldItem* item : qAsConst(it.value())) {
switch (it.key()) {
case Events::Intersects : {
case GameEvents::Intersects : {
QList<const IWorldItem*> result;
for (const IWorldItem *object : qAsConst(_objects)) {
if (item != object && item->intersects(*object)) {
@ -90,9 +92,9 @@ void EventServer::eventProcess() {
}
}
void EventServer::addToSupportedEvents(const IWorldItem * obj, int event) {
void EventServer::addToSupportedGameEvents(const IWorldItem * obj, int event) {
if (obj->isSopportEvent(event)) {
_supportedEvents[event].insert(obj->guiId(), obj);
_supportedGameEvents[event].insert(obj->guiId(), obj);
};
}

@ -58,14 +58,14 @@ signals:
private:
void eventProcess();
void addToSupportedEvents(const IWorldItem *obj, int event);
void addToSupportedGameEvents(const IWorldItem *obj, int event);
void renderLoop();
IWorld * _worldInstance = nullptr;
QHash<int, const IWorldItem*> _objects;
QHash<int, QHash<int, const IWorldItem*>> _supportedEvents;
QList<int> _supportedEventsKeys;
QHash<int, QHash<int, const IWorldItem*>> _supportedGameEvents;
QList<int> _supportedGameEventsKeys;
QFuture<void> _renderLoopFuture;
bool _renderLoop = false;
quint64 _oldTimeRender = 0;

@ -6,6 +6,8 @@
//#
#include "autogenerateclaster.h"
#include "params.h"
namespace ButterflyEngine {
AutoGenerateClaster::AutoGenerateClaster() {

@ -7,6 +7,7 @@
#include "movableobject.h"
#include "ButterflyEngine/core/guiobject.h"
#include <math.h>
namespace ButterflyEngine {

@ -10,8 +10,12 @@
#include <Crawl/irender.h>
#include <Extensions/claster.h>
#include <ButterflyEngine/interfaces/irender.h>
#include <ButterflyEngine/components/claster.h>
#include <QQuaternion>
#include <QVector3D>
namespace ButterflyEngine {

@ -5,14 +5,15 @@
//# of this license document, but changing it is not allowed.
//#
#include "groupobject.h"
#ifndef LAYOUT_H
#define LAYOUT_H
#include <Crawl/groupobject.h>
namespace ButterflyEngine {
class ClasterItem;
/**
* @brief The LayoutType enum Lists the shapes to convert the group object to.
*/

@ -7,8 +7,9 @@
#include "particleeffect.h"
#include "targetdirection.h"
#include "vectordirection.h"
#include "ButterflyEngine/core/vectordirection.h"
#include "ButterflyEngine/core/targetdirection.h"
namespace ButterflyEngine {

@ -6,9 +6,8 @@
//#
#include "Extensions/claster.h"
#include "singleclasterworlditem.h"
#include "quasarapp.h"
#include "ButterflyEngine/components/claster.h"
namespace ButterflyEngine {

@ -10,7 +10,7 @@
#include <QQuaternion>
#include <quasarapp.h>
#include <cmath>
#include "iworld.h"
#include <ButterflyEngine/interfaces/iworld.h>
namespace ButterflyEngine {
@ -34,7 +34,7 @@ Snake::Snake(const QString &name, const QString &viewTempalte, QObject *ptr):
{0.4, 1.2},
{1, 0.5}});
addSupportOfEvent(Events::Intersects);
addSupportOfEvent(GameEvents::Intersects);
}
Snake::~Snake( ){

@ -9,7 +9,7 @@
#ifndef SUN_H
#define SUN_H
#include "Crawl/dayitem.h"
#include "dayitem.h"
namespace ButterflyEngine {

@ -5,9 +5,8 @@
//# of this license document, but changing it is not allowed.
//#
#include "Crawl/viewtemaplatemodel.h"
#include <QVector3D>
#include "global.h"
#include "viewtemaplatemodel.h"
#ifndef TARGETDIRECTION_H
#define TARGETDIRECTION_H
@ -30,7 +29,7 @@ namespace ButterflyEngine {
* @note This class use the CrawlTargetDirection.qml template as a view temaplate.
*/
class TargetDirection: public ViewTemaplateModel
class BUTTERFLY_ENGINE_EXPORT TargetDirection: public ViewTemaplateModel
{
Q_OBJECT

@ -9,9 +9,8 @@
#ifndef VECTORDIRECTION_H
#define VECTORDIRECTION_H
#include "Crawl/viewtemaplatemodel.h"
#include <QVector3D>
#include "global.h"
#include "viewtemaplatemodel.h"
namespace ButterflyEngine {
@ -29,7 +28,7 @@ namespace ButterflyEngine {
*
* @note This class use the CrawlVectorDirection.qml template as a view temaplate.
*/
class VectorDirection: public ViewTemaplateModel
class BUTTERFLY_ENGINE_EXPORT VectorDirection: public ViewTemaplateModel
{
Q_OBJECT

@ -10,7 +10,7 @@
#include <QtCore/qglobal.h>
#define BUTTERFLY_ENGINE_VERSION "0.8.f68816a"
#define BUTTERFLY_ENGINE_VERSION "0.9.03e1259"
#if defined(BUTTERFLY_ENGINE_LIBRARY)
# define BUTTERFLY_ENGINE_EXPORT Q_DECL_EXPORT

@ -6,7 +6,7 @@
//#
#include "ipreviewscaneworld.h"
#include "previewcontrol.h"
#include "ButterflyEngine/core/previewcontrol.h"
namespace ButterflyEngine {

@ -9,7 +9,7 @@
#define IRENDER_H
#include "ButterflyEngine/global.h"
#include "quasarapp.h"
#include "qaglobalutils.h"
namespace ButterflyEngine {

@ -4,24 +4,17 @@
//# Everyone is permitted to copy and distribute verbatim copies
//# of this license document, but changing it is not allowed.
//#
#include "Extensions/claster.h"
#include "iai.h"
#include "iworld.h"
#include "iworlditem.h"
#include <defaultbackgroundai.h>
#include <quasarapp.h>
#include "groundclaster.h"
#include "defaultcontrol.h"
#include "worldstatus.h"
#include "iai.h"
#include "clasteritem.h"
#include "thread"
#include "chrono"
#include "diff.h"
#include "eventserver.h"
#include "player.h"
#include <QtConcurrent>
#include <ButterflyEngine/core/clasteritem.h>
#include <ButterflyEngine/core/defaultcontrol.h>
#include <ButterflyEngine/core/playableobject.h>
#include <ButterflyEngine/components/claster.h>
namespace ButterflyEngine {
@ -166,7 +159,7 @@ bool IWorld::stop() {
}
IAI *IWorld::initBackGroundAI() const {
return new DefaultBackgroundAI();
return nullptr;
}
IWorldItem *IWorld::getItem(int id) const {
@ -250,7 +243,7 @@ void IWorld::removeItem(IWorldItem* item, QList<int> *removedObjectsList) {
void IWorld::reset() {
stop();
IWorld::stop();
if (_player) {
_player = nullptr;

@ -28,9 +28,9 @@ class ClastersTest;
namespace ButterflyEngine {
/**
* @brief The Events enum contains availabele events of the World.
* @brief The GameEvents enum contains availabele events of the World.
*/
enum Events {
enum GameEvents {
/// If object support this event then for them will be check intersection with all not decorative objects.
Intersects = 0x01,
};

@ -58,12 +58,12 @@ void IWorldItem::initOnWorld(const IWorld *world) {
_world = world;
}
int IWorldItem::supportedEvents() const {
return _supportedEvents;
int IWorldItem::supportedGameEvents() const {
return _supportedGameEvents;
}
bool IWorldItem::isSopportEvent(int event) const {
return (_supportedEvents & event) == event;
return (_supportedGameEvents & event) == event;
}
void IWorldItem::destroy() {
@ -99,16 +99,16 @@ void IWorldItem::action(IWorldItem *) {
}
void IWorldItem::setSupportedEvents(int newSupportedEvents) {
_supportedEvents = newSupportedEvents;
void IWorldItem::setSupportedGameEvents(int newSupportedGameEvents) {
_supportedGameEvents = newSupportedGameEvents;
}
void IWorldItem::addSupportOfEvent(int newSupportedEvent) {
_supportedEvents = _supportedEvents | newSupportedEvent;
_supportedGameEvents = _supportedGameEvents | newSupportedEvent;
}
void IWorldItem::dropSupportOfEvent(int depricatedEvent) {
_supportedEvents = _supportedEvents & (~depricatedEvent);
_supportedGameEvents = _supportedGameEvents & (~depricatedEvent);
}
bool IWorldItem::isDecorative() const {

@ -42,14 +42,14 @@ public:
bool isDecorative() const;
/**
* @brief supportedEvents This method return mask of the supported events. For get more information about events see the ButterflyEngine::Events enum.
* @brief supportedGameEvents This method return mask of the supported events. For get more information about events see the ButterflyEngine::GameEvents enum.
* @return integer mask of the supported events.
* @see IWorldItem::setSupportedEvents
* @see IWorldItem::setSupportedGameEvents
* @see IWorldItem::addSupportOfEvent
* @see IWorldItem::dropSupportOfEvent
* @see IWorldItem::supportedEvents
* @see IWorldItem::supportedGameEvents
*/
int supportedEvents() const;
int supportedGameEvents() const;
/**
* @brief isSopportEvent This method return true ithis objects support a @a event.f
@ -109,32 +109,32 @@ protected:
void setFDecorative(bool newFDecorative);
/**
* @brief setSupportedEvents This method overwrite the mask og the supported events.
* @param newSupportedEvents This is new value of the supported events mask.
* @see IWorldItem::setSupportedEvents
* @brief setSupportedGameEvents This method overwrite the mask og the supported events.
* @param newSupportedGameEvents This is new value of the supported events mask.
* @see IWorldItem::setSupportedGameEvents
* @see IWorldItem::addSupportOfEvent
* @see IWorldItem::dropSupportOfEvent
* @see IWorldItem::supportedEvents
* @see IWorldItem::supportedGameEvents
*/
void setSupportedEvents(int newSupportedEvents);
void setSupportedGameEvents(int newSupportedGameEvents);
/**
* @brief addSupportOfEvent This method add support of a @a newSupportedEvent.
* @param newSupportedEvent This is new value of a supported event.
* @see IWorldItem::setSupportedEvents
* @see IWorldItem::setSupportedGameEvents
* @see IWorldItem::addSupportOfEvent
* @see IWorldItem::dropSupportOfEvent
* @see IWorldItem::supportedEvents
* @see IWorldItem::supportedGameEvents
*/
void addSupportOfEvent(int newSupportedEvent);
/**
* @brief dropSupportOfEvent This method drop support of a @a depricatedEvent
* @param depricatedEvent This is event that will be dropped.
* @see IWorldItem::setSupportedEvents
* @see IWorldItem::setSupportedGameEvents
* @see IWorldItem::addSupportOfEvent
* @see IWorldItem::dropSupportOfEvent
* @see IWorldItem::supportedEvents
* @see IWorldItem::supportedGameEvents
*/
void dropSupportOfEvent(int depricatedEvent);
@ -146,7 +146,7 @@ private:
bool _fDecorative = true;
bool _fDistroy = false;
bool _fFirstRenderIteration = true;
int _supportedEvents;
int _supportedGameEvents;
friend class IWorld;
};

@ -4,11 +4,11 @@
"src/build/Debug/ButterflyEngineEaxample.exe"
],
"clear": true,
"binPrefix": "/home/andrei/git/build-ButterflyEngine-Desktop_Qt_6_5_2_GCC_64bit-Debug",
"binPrefix": "/media/D/builds/build-ButterflyEngine-Desktop_Qt_6_5_2_GCC_64bit-Debug",
"libDir": [
"/home/andrei/git/ButterflyEngine",
"/media/D/builds/ButterflyEngine",
"/home/andrei/Qt/6.5.2/gcc_64",
"/home/andrei/git/build-ButterflyEngine-Desktop_Qt_6_5_2_GCC_64bit-Debug"
"/media/D/builds/build-ButterflyEngine-Desktop_Qt_6_5_2_GCC_64bit-Debug"
],
"recursiveDepth": "10",
"deploySystem": false,
@ -17,11 +17,11 @@
"qif": true,
"zip": true,
"ignoreEnv": [
"/home/andrei/git/ButterflyEngine/Distro"
"/media/D/builds/ButterflyEngine/Distro"
],
"extraLib": "crypto",
"targetDir": "/home/andrei/git/ButterflyEngine/Distro",
"deployVersion": "0.8.f68816a",
"targetDir": "/media/D/builds/ButterflyEngine/Distro",
"deployVersion": "0.9.03e1259",
}