feat(title): FSM IDLE/STARTING amb START per jugador i propagació de StartingPlayers
This commit is contained in:
1 parent
1fc3ab8e31
commit
ca64115bfe
9 files changed
+143
-26
No files matched your search
@@ -4,19 +4,24 @@
|
||||
#include <memory>
|
||||
|
||||
#include "core/scene/scene.hpp"
|
||||
#include "game/debug_config.hpp"
|
||||
|
||||
class Text;
|
||||
|
||||
// Escena placeholder de la introducció. Com la resta de placeholders, durada
|
||||
// fixa i skip amb tecla no reservada; quan expira encadena a la factory
|
||||
// injectada (en producció: GameScene).
|
||||
//
|
||||
// `starting_players` és el resultat triat a la TitleScene (P1, P2 o BOTH).
|
||||
// L'IntroScene només el guarda i el reenvia a la seva factory; quan demà
|
||||
// l'intro tinga contingut real podrà variar segons qui jugue.
|
||||
class IntroScene : public Scene {
|
||||
public:
|
||||
using SceneFactory = std::function<std::unique_ptr<Scene>()>;
|
||||
using SceneFactory = std::function<std::unique_ptr<Scene>(DebugConfig::StartingPlayers)>;
|
||||
|
||||
static constexpr int DURATION_MS = 5000;
|
||||
|
||||
IntroScene(std::shared_ptr<Text> font, SceneFactory next_factory);
|
||||
IntroScene(std::shared_ptr<Text> font, DebugConfig::StartingPlayers starting_players, SceneFactory next_factory);
|
||||
~IntroScene() override;
|
||||
|
||||
void update(int delta_ms) override;
|
||||
@@ -24,6 +29,7 @@ class IntroScene : public Scene {
|
||||
|
||||
private:
|
||||
std::shared_ptr<Text> font_;
|
||||
DebugConfig::StartingPlayers starting_players_;
|
||||
SceneFactory next_factory_;
|
||||
int timer_ms_{DURATION_MS};
|
||||
};
|
||||
Reference in new issue
Block a user