🏗️ Created professional C++ architecture: - Factory Engine: Factorio-like production simulation - Economy Engine: Global markets and pricing algorithms - War Engine: Multi-chunk combat and auto-battler - Designer Engine: Vehicle conception (1-2 designs/tick globally) - MacroEntity Engine: Companies, diplomacy, administration points - Map Engine: Procedural generation (218 elements, FOW chunk-based) - Intelligence Engine: Metrics collection (3.1GB adaptive scaling) - Operation Engine: Strategic AI generals with ML adaptation - Logistic Engine: Supply chains and convoy management - Event Engine: Breakthrough system and global events ✅ Each engine includes: - Professional header files with complete interfaces - Autonomous threading and lifecycle management - Inter-engine communication patterns - Performance monitoring capabilities - Organized namespaces (Warfactory::Engine) 🔧 Added .gitignore for C++ development 📦 Added shared/ module for common types 🚀 Ready for CMake setup and implementation
54 lines
1.3 KiB
C++
54 lines
1.3 KiB
C++
#pragma once
|
|
|
|
#include <memory>
|
|
#include <queue>
|
|
#include <thread>
|
|
|
|
namespace Warfactory {
|
|
namespace Event {
|
|
|
|
class GameEvent;
|
|
class BreakthroughSystem;
|
|
class EventQueue;
|
|
|
|
/**
|
|
* Autonomous Event Engine
|
|
* Handles breakthrough system and global events
|
|
*/
|
|
class EventEngine {
|
|
public:
|
|
EventEngine();
|
|
~EventEngine();
|
|
|
|
bool initialize();
|
|
void run();
|
|
void shutdown();
|
|
|
|
// Event management
|
|
void scheduleEvent(std::unique_ptr<GameEvent> event, double delaySeconds);
|
|
void triggerImmediateEvent(std::unique_ptr<GameEvent> event);
|
|
|
|
// Breakthrough system (event-driven with scrap analysis)
|
|
void analyzeScrapForBreakthrough(const std::string& scrapData);
|
|
void triggerBreakthrough(const std::string& technologyDomain);
|
|
|
|
// Global events (geopolitical, natural disasters, etc.)
|
|
void generateRandomEvent();
|
|
void processScheduledEvents();
|
|
|
|
private:
|
|
void engineLoop();
|
|
void updateEventQueue();
|
|
void dispatchEvents();
|
|
|
|
std::unique_ptr<EventQueue> eventQueue_;
|
|
std::unique_ptr<BreakthroughSystem> breakthroughSystem_;
|
|
std::thread engineThread_;
|
|
bool running_;
|
|
|
|
void sendEvents();
|
|
void receiveEventTriggers();
|
|
};
|
|
|
|
} // namespace Event
|
|
} // namespace Warfactory
|