wavelength 1.0.0
Loading...
Searching...
No Matches
duelpatterntable.h
Go to the documentation of this file.
1#pragma once
2
3#include <algorithm>
4#include <vector>
5
6#include "game/duelpattern.h"
7
15public:
17 struct Entry {
18 int mTick;
20 };
21
33 std::vector<Entry>::const_iterator Find(int nTick) const {
34 const auto it = std::upper_bound(
35 mEntries.begin(), mEntries.end(), nTick, [](int nKey, const Entry &entry) {
36 return nKey < entry.mTick;
37 });
38 if (it == mEntries.begin()) {
39 return mEntries.end();
40 }
41 return it - 1;
42 }
43
45 const std::vector<Entry> &GetEntries() const {
46 return mEntries;
47 }
48
50 std::vector<Entry> &GetEntries() {
51 return mEntries;
52 }
53
54private:
55 std::vector<Entry> mEntries;
56};
The duel patterns of a song, each with the tick it applies from, embedded in the song at +0x20.
Definition duelpatterntable.h:14
const std::vector< Entry > & GetEntries() const
Definition duelpatterntable.h:45
std::vector< Entry >::const_iterator Find(int nTick) const
Find the pattern that applies at a tick.
Definition duelpatterntable.h:33
std::vector< Entry > & GetEntries()
Definition duelpatterntable.h:50
Grid of the steps of a bar at which each lane of a duel track may have a gem.
Definition duelpattern.h:17
One pattern and the tick it applies from.
Definition duelpatterntable.h:17
DuelPattern mPattern
Definition duelpatterntable.h:19
int mTick
Definition duelpatterntable.h:18