Cuber/RubixSimulation.hpp

27 lines
517 B
C++
Raw Normal View History

2024-09-18 22:16:03 -06:00
#pragma once
#include <iostream>
class RubixSimulation {
public:
virtual bool Init() = 0;
virtual void Run() = 0;
};
class RubixSimulationRunner {
public:
void SetSimulation(RubixSimulation *simulation) { sim = simulation; }
void StartSimulation() {
if (sim == nullptr) {
std::cout << "No simulation has been set\n";
return;
}
if (!sim->Init()) {
std::cout << "There was an error creating simulation\n";
}
sim->Run();
}
private:
RubixSimulation *sim = nullptr;
};