From b2d4d2cd06e28b012115bdafaa0bd015888d5452 Mon Sep 17 00:00:00 2001 From: skal Date: Sun, 1 Feb 2026 01:47:41 +0100 Subject: Chore: Apply clang-format to the codebase --- tools/seq_compiler.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'tools/seq_compiler.cc') diff --git a/tools/seq_compiler.cc b/tools/seq_compiler.cc index a8a9795..8956c32 100644 --- a/tools/seq_compiler.cc +++ b/tools/seq_compiler.cc @@ -2,6 +2,7 @@ // It implements the sequence compiler tool. // Converts a text-based timeline description into C++ code. +#include #include #include #include @@ -100,6 +101,20 @@ int main(int argc, char* argv[]) { } } + // Sort sequences by priority + std::sort(sequences.begin(), sequences.end(), + [](const SequenceEntry& a, const SequenceEntry& b) { + return std::stoi(a.priority) < std::stoi(b.priority); + }); + + // Sort effects within each sequence by priority + for (auto& seq : sequences) { + std::sort(seq.effects.begin(), seq.effects.end(), + [](const EffectEntry& a, const EffectEntry& b) { + return std::stoi(a.priority) < std::stoi(b.priority); + }); + } + std::ofstream out_file(argv[2]); if (!out_file.is_open()) { std::cerr << "Error: Could not open output file " << argv[2] << "\n"; -- cgit v1.2.3