mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-17 05:09:20 +02:00
refactor(editor): the self-test runner dispatches its commands to seven groups (scene, bends and lineside, tracks and routes, switches, joining and gizmo, signals, terrain) instead of one function with 95 branches; deletetrack without a name deletes the selected path, which its second, unreachable branch meant to do
This commit is contained in:
@@ -36,6 +36,7 @@ http://mozilla.org/MPL/2.0/.
|
|||||||
#include <functional>
|
#include <functional>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <optional>
|
#include <optional>
|
||||||
|
#include <sstream>
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
@@ -1804,6 +1805,20 @@ class editor_mode : public application_mode, private editor_track::observer
|
|||||||
bool quitting{false};
|
bool quitting{false};
|
||||||
};
|
};
|
||||||
selftest m_selftest;
|
selftest m_selftest;
|
||||||
|
enum class selftest_result
|
||||||
|
{
|
||||||
|
unhandled,
|
||||||
|
handled,
|
||||||
|
pause
|
||||||
|
};
|
||||||
|
selftest_result selftest_scene(std::string const &command, std::istringstream &words);
|
||||||
|
selftest_result selftest_sweep(std::string const &command, std::istringstream &words);
|
||||||
|
selftest_result selftest_track(std::string const &command, std::istringstream &words);
|
||||||
|
selftest_result selftest_switch(std::string const &command, std::istringstream &words);
|
||||||
|
selftest_result selftest_join(std::string const &command, std::istringstream &words);
|
||||||
|
selftest_result selftest_signal(std::string const &command, std::istringstream &words);
|
||||||
|
selftest_result selftest_terrain(std::string const &command, std::istringstream &words);
|
||||||
|
selftest_result selftest_dispatch(std::string const &command, std::istringstream &words);
|
||||||
void selftest_step();
|
void selftest_step();
|
||||||
// a value typed during a gesture, taken instead of the one the cursor gives
|
// a value typed during a gesture, taken instead of the one the cursor gives
|
||||||
std::string m_typed;
|
std::string m_typed;
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user