|
wiRedPanda
Logic Circuit Simulator
|
#include <ExerciseEngine.h>
Public Member Functions | |
| void | advanceStep () |
| Manually advances one step (used by the overlay Next/Finish button for observe steps). | |
| int | currentStep () const |
| const ExerciseStep & | currentStepData () const |
| Returns the data for the current step. Caller must check isActive() first. | |
| void | exerciseCompleted () |
| ExerciseEngine (QObject *parent=nullptr) | |
| QString | exerciseId () const |
| void | exerciseStopped () |
| QString | exerciseTitle () const |
| void | goToPreviousStep () |
| bool | isActive () const |
| bool | loadFromResource (const QString &resourcePath) |
| void | retranslate () |
| void | retranslated () |
| void | setScene (Scene *scene) |
| void | start () |
| void | stepChanged (int step, int total, const ExerciseStep &data) |
| void | stepCompleted (int step) |
| void | stop () |
| int | totalSteps () const |
Definition at line 15 of file ExerciseEngine.h.
|
explicit |
Definition at line 55 of file ExerciseEngine.cpp.
References Settings::completedExercises(), Settings::exerciseProgress(), Settings::setCompletedExercises(), and Settings::setExerciseProgress().
| void ExerciseEngine::advanceStep | ( | ) |
Manually advances one step (used by the overlay Next/Finish button for observe steps).
Definition at line 126 of file ExerciseEngine.cpp.
|
inline |
Definition at line 33 of file ExerciseEngine.h.
| const ExerciseStep & ExerciseEngine::currentStepData | ( | ) | const |
Returns the data for the current step. Caller must check isActive() first.
Definition at line 79 of file ExerciseEngine.cpp.
| void ExerciseEngine::exerciseCompleted | ( | ) |
|
inline |
Definition at line 26 of file ExerciseEngine.h.
| void ExerciseEngine::exerciseStopped | ( | ) |
Referenced by stop().
|
inline |
Definition at line 27 of file ExerciseEngine.h.
| void ExerciseEngine::goToPreviousStep | ( | ) |
Definition at line 106 of file ExerciseEngine.cpp.
|
inline |
Definition at line 35 of file ExerciseEngine.h.
| bool ExerciseEngine::loadFromResource | ( | const QString & | resourcePath | ) |
Loads an exercise from a Qt resource path (e.g. ":/Exercises/basic-and-gate.json"). Returns false and leaves the engine inactive if the resource is missing or malformed.
Definition at line 63 of file ExerciseEngine.cpp.
| void ExerciseEngine::retranslate | ( | ) |
Re-translates the title and all steps' instruction/hint text for the current language, preserving currentStep()/isActive(). No-op if never loaded or inactive. Emits retranslated() (never stepChanged()) so listeners can't replay step-entry side effects like MainWindow's click-target handling.
Definition at line 131 of file ExerciseEngine.cpp.
References retranslated().
| void ExerciseEngine::retranslated | ( | ) |
Referenced by retranslate().
| void ExerciseEngine::setScene | ( | Scene * | scene | ) |
Binds the engine to scene. Disconnects the previous scene if any. Pass nullptr to detach without binding a new scene.
Definition at line 68 of file ExerciseEngine.cpp.
References Scene::circuitHasChanged().
| void ExerciseEngine::start | ( | ) |
Definition at line 84 of file ExerciseEngine.cpp.
References Scene::circuitHasChanged().
| void ExerciseEngine::stepChanged | ( | int | step, |
| int | total, | ||
| const ExerciseStep & | data ) |
| void ExerciseEngine::stepCompleted | ( | int | step | ) |
| void ExerciseEngine::stop | ( | ) |
Definition at line 95 of file ExerciseEngine.cpp.
References Scene::circuitHasChanged(), and exerciseStopped().
|
inline |
Definition at line 34 of file ExerciseEngine.h.