- Remove old 10-engine system (engines/ directory deleted) - Implement C++ triple interface architecture: * IEngine: Execution coordination (Debug → Production) * IModuleSystem: Strategy pattern (Sequential → Threaded → Cluster) * IModule: Pure game logic interface (200-300 lines per module) * IIO: Communication transport (Intra → Local → Network) - Add autonomous module structure: * modules/factory/: Production logic with autonomous build * modules/economy/: Market simulation with autonomous build * modules/logistic/: Supply chain with autonomous build * Each module: CLAUDE.md + CMakeLists.txt + shared/ + build/ - Benefits for Claude Code development: * Ultra-focused contexts (200 lines vs 50K+ lines) * Autonomous builds (cmake . from module directory) * Hot-swappable infrastructure without logic changes * Parallel development across multiple Claude instances 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
51 lines
1.2 KiB
C++
51 lines
1.2 KiB
C++
#pragma once
|
|
|
|
#include <string>
|
|
#include <nlohmann/json.hpp>
|
|
|
|
using json = nlohmann::json;
|
|
|
|
namespace warfactory {
|
|
|
|
/**
|
|
* @brief Pure game logic interface - Claude Code works ONLY on this
|
|
*
|
|
* Each module = 200-500 lines of pure game logic
|
|
* No infrastructure code, no threading, no networking
|
|
* Just: receive JSON input -> process logic -> return JSON output
|
|
*/
|
|
class IModule {
|
|
public:
|
|
virtual ~IModule() = default;
|
|
|
|
/**
|
|
* @brief Initialize module with configuration
|
|
* @param config JSON configuration for this module
|
|
*/
|
|
virtual void initialize(const json& config) = 0;
|
|
|
|
/**
|
|
* @brief Process game logic - PURE FUNCTION
|
|
* @param input JSON input from other modules or engine
|
|
* @return JSON output to send to other modules
|
|
*/
|
|
virtual json process(const json& input) = 0;
|
|
|
|
/**
|
|
* @brief Get module metadata
|
|
* @return Module name, version, dependencies
|
|
*/
|
|
virtual json getMetadata() const = 0;
|
|
|
|
/**
|
|
* @brief Cleanup resources
|
|
*/
|
|
virtual void shutdown() = 0;
|
|
|
|
/**
|
|
* @brief Module name for identification
|
|
*/
|
|
virtual std::string getName() const = 0;
|
|
};
|
|
|
|
} // namespace warfactory
|