|
|
@ -6,18 +6,21 @@ constexpr int eventStringMax = 6; |
|
|
|
|
|
|
|
|
|
|
|
void Logger::OnCoinCollected(CoinCollectEvent *event) { |
|
|
|
void Logger::OnCoinCollected(CoinCollectEvent *event) { |
|
|
|
char buffer[MAX_STRING]; |
|
|
|
char buffer[MAX_STRING]; |
|
|
|
sprintf(buffer, "Game event: %*s | time: %6.2f | value: %d\n", eventStringMax, "Coin", event->time, event->value); |
|
|
|
sprintf(buffer, "Game event: %*s | time: %6.2f | value: %d\n", |
|
|
|
|
|
|
|
eventStringMax, "Coin", event->time, event->value); |
|
|
|
FileManager::instance->writeFile("log.txt", buffer, true); |
|
|
|
FileManager::instance->writeFile("log.txt", buffer, true); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void Logger::OnWallJumped(WallJumpEvent *event) { |
|
|
|
void Logger::OnWallJumped(WallJumpEvent *event) { |
|
|
|
char buffer[MAX_STRING]; |
|
|
|
char buffer[MAX_STRING]; |
|
|
|
sprintf(buffer, "Game event: %*s | time: %6.2f | wall_height: %6.2f\n", eventStringMax, "Jump", event->time, event->wallHeight); |
|
|
|
sprintf(buffer, "Game event: %*s | time: %6.2f | wall_height: %6.2f\n", |
|
|
|
|
|
|
|
eventStringMax, "Jump", event->time, event->wallHeight); |
|
|
|
FileManager::instance->writeFile("log.txt", buffer, true); |
|
|
|
FileManager::instance->writeFile("log.txt", buffer, true); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void Logger::OnWallCrashed(WallCrashEvent *event) { |
|
|
|
void Logger::OnWallCrashed(WallCrashEvent *event) { |
|
|
|
char buffer[MAX_STRING]; |
|
|
|
char buffer[MAX_STRING]; |
|
|
|
sprintf(buffer, "Game event: %*s | time: %6.2f | wall_height: %6.2f\n", eventStringMax, "Crash", event->time, event->wallHeight); |
|
|
|
sprintf(buffer, "Game event: %*s | time: %6.2f | wall_height: %6.2f\n", |
|
|
|
|
|
|
|
eventStringMax, "Crash", event->time, event->wallHeight); |
|
|
|
FileManager::instance->writeFile("log.txt", buffer, true); |
|
|
|
FileManager::instance->writeFile("log.txt", buffer, true); |
|
|
|
} |
|
|
|
} |
|
|
|