GroveEngine/tests/modules/TankModule.h
StillHammer edf4d76844 fix: Windows MinGW CTest compatibility - DLL loading and module paths
- Add cmake -E chdir wrapper for CTest on Windows to resolve DLL loading
- Auto-copy MinGW runtime DLLs to build directories during configure
- Fix module paths in integration tests (.so -> .dll for Windows)
- Update grove_add_test macro for cross-platform test registration

Tests now pass: 55% (16/29) on Windows MinGW

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 20:04:44 +07:00

49 lines
1.4 KiB
C++

#pragma once
#include "grove/IModule.h"
#include "grove/IDataNode.h"
#include <vector>
#include <random>
#include <memory>
#include <spdlog/spdlog.h>
namespace grove {
class TankModule : public IModule {
public:
struct Tank {
float x, y; // Position
float vx, vy; // Vélocité
float cooldown; // Temps avant prochain tir
float targetX, targetY; // Destination
int id; // Identifiant unique
};
// IModule interface
void process(const IDataNode& input) override;
void setConfiguration(const IDataNode& configNode, IIO* io, ITaskScheduler* scheduler) override;
const IDataNode& getConfiguration() override;
std::unique_ptr<IDataNode> getHealthStatus() override;
void shutdown() override;
std::unique_ptr<IDataNode> getState() override;
void setState(const IDataNode& state) override;
std::string getType() const override;
bool isIdle() const override { return true; }
private:
std::vector<Tank> tanks;
int frameCount = 0;
std::string moduleVersion = "v2.0 HOT-RELOADED";:shared_ptr<spdlog::logger> logger;
std::unique_ptr<IDataNode> config;
void updateTank(Tank& tank, float dt);
void spawnTanks(int count);
};
} // namespace grove
// Export symbols
extern "C" {
grove::IModule* createModule();
void destroyModule(grove::IModule* module);
}