Création Test

This commit is contained in:
Crizomb 2025-06-13 01:25:45 +02:00
parent 611ff37653
commit dd67b76d1f
6 changed files with 79 additions and 6 deletions

View file

@ -19,11 +19,24 @@ private:
// Constructor is rivate, use create
NoteTile(float play_time, float good_interval, NotePlaceEnum place);
// For unit testing
public:
// Good key press for this note, is if player press good place, within
// [play_time - good_interval/2, play_time + good_interval/2]
static void create(float play_time, float good_interval, NotePlaceEnum place);
// Usefull in test, but don't use it anywhere
static void clear() { existing_tiles.clear(); };
// Should be called when one of arrows key pressed, return True if it's a good
// press
bool CheckPress(float press_time, NotePlaceEnum key_pressed);
bool checkPress(float press_time, NotePlaceEnum key_pressed);
// Some getters usefull in test :
float getPlayTime() const { return play_time; };
float getGoodInterval() const { return good_interval; };
NotePlaceEnum getPlace() const { return place; };
NoteSprite getNodeSprite() const { return note_sprite; };
static const std::vector<std::unique_ptr<NoteTile>> &getExistingTiles() {
return existing_tiles;
};
};