🏗️ 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
57 lines
1.2 KiB
C++
57 lines
1.2 KiB
C++
#pragma once
|
|
|
|
#include <memory>
|
|
#include <vector>
|
|
#include <thread>
|
|
|
|
namespace Warfactory {
|
|
namespace Factory {
|
|
|
|
class ProductionLine;
|
|
class Belt;
|
|
class Assembler;
|
|
|
|
/**
|
|
* Autonomous Factory Engine
|
|
* Handles Factorio-like production simulation
|
|
*/
|
|
class FactoryEngine {
|
|
public:
|
|
FactoryEngine();
|
|
~FactoryEngine();
|
|
|
|
// Engine lifecycle
|
|
bool initialize();
|
|
void run();
|
|
void shutdown();
|
|
|
|
// Factory management
|
|
void addProductionLine(std::unique_ptr<ProductionLine> line);
|
|
void removeProductionLine(int lineId);
|
|
|
|
// Production control
|
|
void startProduction();
|
|
void stopProduction();
|
|
void pauseProduction();
|
|
|
|
// Performance monitoring
|
|
double getTickRate() const { return tickRate_; }
|
|
size_t getActiveLines() const { return productionLines_.size(); }
|
|
|
|
private:
|
|
void engineLoop();
|
|
void updateProduction();
|
|
void processInputOutput();
|
|
|
|
std::vector<std::unique_ptr<ProductionLine>> productionLines_;
|
|
std::thread engineThread_;
|
|
bool running_;
|
|
double tickRate_;
|
|
|
|
// Communication with other engines
|
|
void sendProductionData();
|
|
void receiveOrders();
|
|
};
|
|
|
|
} // namespace Factory
|
|
} // namespace Warfactory
|