fixed for cooperate mode

This commit is contained in:
2025-12-22 13:48:54 +01:00
parent 694243ac89
commit 18463774e9
4 changed files with 311 additions and 1 deletions

View File

@ -57,7 +57,9 @@ public:
explicit CoopGame(int startLevel = 0);
using SoundCallback = std::function<void(int)>;
using LevelUpCallback = std::function<void(int)>;
void setSoundCallback(SoundCallback cb) { soundCallback = cb; }
void setLevelUpCallback(LevelUpCallback cb) { levelUpCallback = cb; }
void reset(int startLevel = 0);
void tickGravity(double frameMs);
@ -137,6 +139,7 @@ private:
uint32_t hardDropFxId{0};
uint64_t pieceSequence{0};
SoundCallback soundCallback;
LevelUpCallback levelUpCallback;
// Helpers ---------------------------------------------------------------
PlayerState& player(PlayerSide s) { return s == PlayerSide::Left ? left : right; }