Add machine workshop, typed logic, mechanics and sensor-driven ECUs
This commit is contained in:
@@ -2,6 +2,26 @@
|
||||
#include "FluidSim/ScenarioCatalog.hpp"
|
||||
#include <SFML/Graphics.hpp>
|
||||
#include <optional>
|
||||
#include <memory>
|
||||
namespace fluidsim::port::desktop {
|
||||
std::optional<std::size_t> choose_scenario(sf::RenderWindow&,const sf::Font*,const std::vector<ScenarioExample>&);
|
||||
struct ScenarioMenuChoice {
|
||||
std::optional<std::size_t> example;
|
||||
std::filesystem::path machine;
|
||||
bool play{};
|
||||
};
|
||||
enum class MenuScreen {Home,Workshop,Scenarios};
|
||||
class ScenarioMenu {
|
||||
public:
|
||||
ScenarioMenu(std::vector<ScenarioExample>,std::vector<std::filesystem::path> machines={});
|
||||
~ScenarioMenu();
|
||||
bool handle_event(const sf::Event&,sf::Vector2u);
|
||||
void draw(sf::RenderWindow&,const sf::Font*);
|
||||
bool finished()const;
|
||||
MenuScreen screen()const;
|
||||
std::optional<ScenarioMenuChoice> take_choice();
|
||||
private:
|
||||
struct Impl;
|
||||
std::unique_ptr<Impl> impl_;
|
||||
};
|
||||
std::optional<ScenarioMenuChoice> choose_scenario(sf::RenderWindow&,const sf::Font*,const std::vector<ScenarioExample>&);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user