warfactoryracine/engines/Logistic-Engine/include/logistic-engine/LogisticEngine.h
StillHammer 4eb1ad69a3 Add complete C++ structure for all 10 engines
🏗️ 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
2025-09-19 02:07:17 +08:00

56 lines
1.5 KiB
C++

#pragma once
#include <memory>
#include <vector>
#include <thread>
#include <unordered_map>
namespace Warfactory {
namespace Logistic {
class Convoy;
class Route;
class SupplyChain;
/**
* Autonomous Logistic Engine
* Handles transport and supply chains
*/
class LogisticEngine {
public:
LogisticEngine();
~LogisticEngine();
bool initialize();
void run();
void shutdown();
// Supply chain management
void createSupplyChain(const std::string& chainId, const std::vector<int>& sites);
void updateRoute(const std::string& routeId, const std::vector<std::pair<int,int>>& waypoints);
// Convoy management
void dispatchConvoy(const std::string& convoyId, const std::string& routeId);
void trackConvoyProgress(const std::string& convoyId);
// Infrastructure (routes visible on map, attackable)
void markInfrastructureVulnerable(const std::string& routeId, bool vulnerable);
bool isRouteSecure(const std::string& routeId) const;
private:
void engineLoop();
void updateConvoys();
void optimizeRoutes();
std::unordered_map<std::string, std::unique_ptr<SupplyChain>> supplyChains_;
std::unordered_map<std::string, std::unique_ptr<Route>> routes_;
std::unordered_map<std::string, std::unique_ptr<Convoy>> convoys_;
std::thread engineThread_;
bool running_;
void sendLogisticData();
void receiveTransportRequests();
};
} // namespace Logistic
} // namespace Warfactory