Skip to content

Commit b753ee4

Browse files
committed
Port Tier 1-2 GameDevJs example systems to engine
Extract and promote generic utilities and systems from GameDevJs2026 example into main engine under pg namespace: - Deduplicate setEntityVisibility → pg::setEntityVisibility (UI/utils.h) - Promote XorShift32 → pg::LocalRng (Maths/randomnumbergenerator.h) - Move GridAtlas → pg::GridAtlasLoader (Loaders/) - Promote WorldFacts/FactChecker → Systems/factsystem.h/.cpp - Move AutoSaveSystem → Systems/autosavesystem.h - Move CameraSystem → 2D/camerasystem.h/.cpp, decoupled from grid.h (initial center now a constructor param) and InventoryUISystem (zoom suppression now a callback) Update CMakeLists.txt source lists. Fix stale CameraSystem forward declarations in placementoverlaysystem.h, spotlightoverlaysystem.h, tileinspectorsystem.h, tutorialsystem.h that caused name collisions.
1 parent 7a5b21b commit b753ee4

4 files changed

Lines changed: 8 additions & 4 deletions

File tree

examples/GameDevJs2026/Systems/placementoverlaysystem.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
#include <cstdint>
1010

1111
class HotbarSystem;
12-
class CameraSystem;
12+
namespace pg { class CameraSystem; }
13+
using pg::CameraSystem;
1314

1415
// When the player has a building selected in the hotbar, tints the grid
1516
// cell(s) under the ghost preview green (placeable) or red (blocked).

examples/GameDevJs2026/UI/spotlightoverlaysystem.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99

1010
#include "tutorialevents.h"
1111

12-
class CameraSystem;
12+
namespace pg { class CameraSystem; }
13+
using pg::CameraSystem;
1314

1415
// Imperative overlay used by the tutorial to focus the player on a single
1516
// target (a world tile, a UI element, or a fixed screen rect). Renders:

examples/GameDevJs2026/UI/tileinspectorsystem.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
#include <cstdint>
1212
#include <string>
1313

14-
class CameraSystem;
14+
namespace pg { class CameraSystem; }
15+
using pg::CameraSystem;
1516
class GridSystem;
1617
class HotbarSystem;
1718
class HudBarSystem;

examples/GameDevJs2026/UI/tutorialsystem.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
#include "tutorialevents.h"
1717

1818
class SpotlightOverlaySystem;
19-
class CameraSystem;
19+
namespace pg { class CameraSystem; }
20+
using pg::CameraSystem;
2021

2122
// Forced early-game tutorial. State persists in WorldFacts as `tutorial_step`.
2223
// Each state advances on a specific event. The two ValidateMission* steps gate

0 commit comments

Comments
 (0)