From 82929e16bf9acbaef6a815da4ff9a7a7d918c5f2 Mon Sep 17 00:00:00 2001 From: jacekpoz Date: Sat, 20 Apr 2024 12:08:55 +0200 Subject: [PATCH] add util stream ops and print difficulty on -p --- include/util_stream_ops.hpp | 25 ++++++++++++++++++ src/main.cpp | 52 +++++++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100644 include/util_stream_ops.hpp diff --git a/include/util_stream_ops.hpp b/include/util_stream_ops.hpp new file mode 100644 index 0000000..22e19ce --- /dev/null +++ b/include/util_stream_ops.hpp @@ -0,0 +1,25 @@ +#pragma once + +#include +#include +#include + +#include + +std::ostream &operator<<(std::ostream &stream, const sf::Color &color) { + stream << "Color(" << color.r << ", " << color.g << ", " << color.b << ", " << color.a << ")"; + return stream; +} + +template +std::ostream &operator<<(std::ostream &stream, const std::vector &vec) { + stream << "["; + for (size_t i = 0; i < vec.size(); ++i) { + stream << vec.at(i); + if (i != vec.size() - 1) { + stream << ", "; + } + } + stream << "]"; + return stream; +} diff --git a/src/main.cpp b/src/main.cpp index a87b339..a9e940a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include #include @@ -62,6 +63,57 @@ int main(int argc, char *argv[]) { i += 1; Difficulty diff = parseDifficulty(argv[i]); + std::cout << "osu format version: " << diff.formatVersion << "\n"; + + std::cout << "general.audioFilename: " << diff.general.audioFilename << "\n"; + std::cout << "general.audioLeadIn: " << diff.general.audioLeadIn << "\n"; + std::cout << "general.previewTime: " << diff.general.previewTime << "\n"; + std::cout << "general.countdown: " << diff.general.countdown << "\n"; + std::cout << "general.sampleSet: " << diff.general.sampleSet << "\n"; + std::cout << "general.stackLeniency: " << diff.general.stackLeniency << "\n"; + std::cout << "general.mode: " << diff.general.mode << "\n"; + std::cout << "general.letterboxInBreaks: " << diff.general.letterboxInBreaks << "\n"; + std::cout << "general.useSkinSprites: " << diff.general.useSkinSprites << "\n"; + std::cout << "general.overlayPosition: " << diff.general.overlayPosition << "\n"; + std::cout << "general.skinPreference: " << diff.general.skinPreference << "\n"; + std::cout << "general.epilepsyWarning: " << diff.general.epilepsyWarning << "\n"; + std::cout << "general.countdownOffset: " << diff.general.countdownOffset << "\n"; + std::cout << "general.specialStyle: " << diff.general.specialStyle << "\n"; + std::cout << "general.widescreenStoryboard: " << diff.general.widescreenStoryboard << "\n"; + std::cout << "general.sampleMatchPlaybackRate: " << diff.general.sampleMatchPlaybackRate << "\n"; + + std::cout << "editor.bookmarks: " << diff.editor.bookmarks << "\n"; + std::cout << "editor.distanceSpacing: " << diff.editor.distanceSpacing << "\n"; + std::cout << "editor.beatDivisor: " << diff.editor.beatDivisor << "\n"; + std::cout << "editor.gridSize: " << diff.editor.gridSize << "\n"; + std::cout << "editor.timelineZoom: " << diff.editor.timelineZoom << "\n"; + + std::cout << "metadata.title: " << diff.metadata.title << "\n"; + std::cout << "metadata.titleUnicode: " << diff.metadata.titleUnicode << "\n"; + std::cout << "metadata.artist: " << diff.metadata.artist << "\n"; + std::cout << "metadata.artistUnicode: " << diff.metadata.artistUnicode << "\n"; + std::cout << "metadata.creator: " << diff.metadata.creator << "\n"; + std::cout << "metadata.version: " << diff.metadata.version << "\n"; + std::cout << "metadata.source: " << diff.metadata.source << "\n"; + std::cout << "metadata.tags: " << diff.metadata.tags << "\n"; + std::cout << "metadata.beatmapID: " << diff.metadata.beatmapID << "\n"; + std::cout << "metadata.beatmapSetID: " << diff.metadata.beatmapSetID << "\n"; + + std::cout << "difficulty.hpDrainRate: " << diff.difficulty.hpDrainRate << "\n"; + std::cout << "difficulty.circleSize: " << diff.difficulty.circleSize << "\n"; + std::cout << "difficulty.overallDifficulty: " << diff.difficulty.overallDifficulty << "\n"; + std::cout << "difficulty.approachRate: " << diff.difficulty.approachRate << "\n"; + std::cout << "difficulty.sliderMultiplier: " << diff.difficulty.sliderMultiplier << "\n"; + std::cout << "difficulty.sliderTickRate: " << diff.difficulty.sliderTickRate << "\n"; + + std::cout << "timingPoints: " << diff.timingPoints << "\n"; + + std::cout << "colours.combo: " << diff.colours.combo << "\n"; + std::cout << "colours.sliderTrackOverride: " << diff.colours.sliderTrackOverride << "\n"; + std::cout << "colours.sliderBorder: " << diff.colours.sliderBorder << "\n"; + + std::cout << "hitObjects: " << diff.hitObjects << "\n"; + std::exit(EXIT_SUCCESS); }