Browse Source

Refactor app/ folder structure: move files to core/, models/, controllers/, utils/

Co-authored-by: djeada <[email protected]>
copilot-swe-agent[bot] 2 months ago
parent
commit
02c45f59ff

+ 8 - 8
CMakeLists.txt

@@ -49,10 +49,10 @@ add_subdirectory(tools)
 if(QT_VERSION_MAJOR EQUAL 6)
     qt6_add_executable(standard_of_iron
         main.cpp
-        app/game_engine.cpp
-        app/cursor_manager.cpp
-        app/hover_tracker.cpp
-        app/selected_units_model.cpp
+        app/core/game_engine.cpp
+        app/models/cursor_manager.cpp
+        app/models/hover_tracker.cpp
+        app/models/selected_units_model.cpp
         app/controllers/command_controller.cpp
         app/controllers/action_vfx.cpp
         ui/gl_view.cpp
@@ -61,10 +61,10 @@ if(QT_VERSION_MAJOR EQUAL 6)
 else()
     add_executable(standard_of_iron
         main.cpp
-        app/game_engine.cpp
-        app/cursor_manager.cpp
-        app/hover_tracker.cpp
-        app/selected_units_model.cpp
+        app/core/game_engine.cpp
+        app/models/cursor_manager.cpp
+        app/models/hover_tracker.cpp
+        app/models/selected_units_model.cpp
         app/controllers/command_controller.cpp
         app/controllers/action_vfx.cpp
         ui/gl_view.cpp

+ 5 - 5
app/game_engine.cpp → app/core/game_engine.cpp

@@ -1,9 +1,9 @@
 #include "game_engine.h"
 
-#include "controllers/action_vfx.h"
-#include "controllers/command_controller.h"
-#include "cursor_manager.h"
-#include "hover_tracker.h"
+#include "../controllers/action_vfx.h"
+#include "../controllers/command_controller.h"
+#include "../models/cursor_manager.h"
+#include "../models/hover_tracker.h"
 #include <QCoreApplication>
 #include <QCursor>
 #include <QDebug>
@@ -56,7 +56,7 @@
 #include "render/ground/stone_renderer.h"
 #include "render/ground/terrain_renderer.h"
 #include "render/scene_renderer.h"
-#include "selected_units_model.h"
+#include "../models/selected_units_model.h"
 #include <QDir>
 #include <QFile>
 #include <QJsonArray>

+ 5 - 5
app/game_engine.h → app/core/game_engine.h

@@ -1,11 +1,11 @@
 #pragma once
 
-#include "cursor_manager.h"
+#include "../models/cursor_manager.h"
 #include "game/core/event_manager.h"
-#include "hover_tracker.h"
-#include "utils/engine_view_helpers.h"
-#include "utils/movement_utils.h"
-#include "utils/selection_utils.h"
+#include "../models/hover_tracker.h"
+#include "../utils/engine_view_helpers.h"
+#include "../utils/movement_utils.h"
+#include "../utils/selection_utils.h"
 #include <QMatrix4x4>
 #include <QObject>
 #include <QPointF>

+ 0 - 0
app/cursor_manager.cpp → app/models/cursor_manager.cpp


+ 0 - 0
app/cursor_manager.h → app/models/cursor_manager.h


+ 0 - 0
app/hover_tracker.cpp → app/models/hover_tracker.cpp


+ 0 - 0
app/hover_tracker.h → app/models/hover_tracker.h


+ 4 - 4
app/selected_units_model.cpp → app/models/selected_units_model.cpp

@@ -1,8 +1,8 @@
 #include "selected_units_model.h"
-#include "../game/core/component.h"
-#include "../game/core/world.h"
-#include "../game/systems/selection_system.h"
-#include "game_engine.h"
+#include "../../game/core/component.h"
+#include "../../game/core/world.h"
+#include "../../game/systems/selection_system.h"
+#include "../core/game_engine.h"
 #include <algorithm>
 
 SelectedUnitsModel::SelectedUnitsModel(GameEngine *engine, QObject *parent)

+ 1 - 1
app/selected_units_model.h → app/models/selected_units_model.h

@@ -1,6 +1,6 @@
 #pragma once
 
-#include "../game/core/entity.h"
+#include "../../game/core/entity.h"
 #include <QAbstractListModel>
 #include <vector>
 

+ 1 - 1
main.cpp

@@ -11,7 +11,7 @@
 #include <QSurfaceFormat>
 #include <QTextStream>
 
-#include "app/game_engine.h"
+#include "app/core/game_engine.h"
 #include "ui/gl_view.h"
 #include "ui/theme.h"
 

+ 1 - 1
ui/gl_view.cpp

@@ -1,5 +1,5 @@
 #include "gl_view.h"
-#include "../app/game_engine.h"
+#include "../app/core/game_engine.h"
 
 #include <QOpenGLFramebufferObject>
 #include <QOpenGLFramebufferObjectFormat>