wavelength 1.0.0
Loading...
Searching...
No Matches
duel.h
Go to the documentation of this file.
1#pragma once
2
3#include "game/btnevent.h"
5#include "game/duellogic.h"
6#include "game/gamedb.h"
8#include "game/rotateevent.h"
9#include "game/stickevent.h"
10#include "game/world.h"
11
19class Duel : public World {
20public:
28
35 ~Duel() override;
36
44 int GetRuleSet() const override {
46 }
47
55 bool IsFinished() override;
56
64 void Handle(const RotateEvent &event) override;
65
73 void Handle(const PlayNoteEvent &event) override;
74
82 void Handle([[maybe_unused]] const BtnEvent<8> &event) override {
83 }
84
92 void Handle(const StickEvent<2> &event) override;
93
101 void Handle(const StickEvent<6> &event) override;
102
110 void Handle(const BtnEvent<3> &event) override;
111
119 void Handle(const BtnEvent<4> &event) override;
120
128 void Handle(const BtnEvent<5> &event) override;
129
137 void Handle([[maybe_unused]] const ChangeSectionEvent &event) override {
138 }
139
147 void Handle([[maybe_unused]] const BtnEvent<9> &event) override {
148 }
149
157 void Handle([[maybe_unused]] const BtnEvent<10> &event) override {
158 }
159
169 void BeginAssetLoad() override;
170
177 void PollAssetLoad() override {
178 }
179
187 bool IsAssetLoadDone() override;
188
195 void BeginSongLoad() override;
196
203 void PollSongLoad() override {
204 }
205
213 bool IsSongLoadDone() override;
214
221 void BeginEnding() override;
222
229 void PollEnding() override;
230
238 bool IsEndingDone() override;
239
246 void CreateLogic() override;
247
254 void OnStart() override;
255
263 void BuildTracks(int nStartTick) override;
264
272 void SetLogic(DuelLogic *pLogic);
273
274private:
275 DuelLogic *mLogic;
276 int mFxBankSlot;
277};
Input event of a button press that names only the player.
Definition btnevent.h:15
Input event that changes the section a player is on.
Definition changesectionevent.h:10
Rules of the duel rule set.
Definition duellogic.h:35
void Handle(const RotateEvent &event) override
Record a rotation.
void PollEnding() override
Advance the sequence that follows the end of the duel.
void Handle(const PlayNoteEvent &event) override
Record a gem button.
void PollSongLoad() override
Advance the song load.
Definition duel.h:203
void OnStart() override
Finish starting the song.
void Handle(const ChangeSectionEvent &event) override
Ignore a section change.
Definition duel.h:137
void Handle(const BtnEvent< 8 > &event) override
Ignore a button event of command 8.
Definition duel.h:82
bool IsFinished() override
Report whether the duel ended without a player abandoning it.
void Handle(const StickEvent< 2 > &event) override
Record a stick event of command 2.
void PollAssetLoad() override
Advance the effect bank load.
Definition duel.h:177
bool IsAssetLoadDone() override
Report whether the effect bank is loaded.
bool IsEndingDone() override
Advance the song's track loader and report whether it finished.
void BuildTracks(int nStartTick) override
Build the display of the two players' tracks.
void SetLogic(DuelLogic *pLogic)
Install the logic in the world and keep it in mLogic.
void Handle(const BtnEvent< 5 > &event) override
Record a button event of command 5.
void Handle(const StickEvent< 6 > &event) override
Record a stick event of command 6.
void BeginAssetLoad() override
Load the effect bank of the duel into its synthesiser slot.
void CreateLogic() override
Build a DuelLogic for the song and install it.
int GetRuleSet() const override
Report the duel rule set.
Definition duel.h:44
Duel()
Construct a duel world.
void Handle(const BtnEvent< 4 > &event) override
Record a button event of command 4.
void BeginEnding() override
Stop the song's track loader and start it again.
bool IsSongLoadDone() override
Advance the song's track loader and report whether it finished.
void Handle(const BtnEvent< 9 > &event) override
Ignore a button event of command 9.
Definition duel.h:147
void Handle(const BtnEvent< 3 > &event) override
Record a button event of command 3.
~Duel() override
Release the world.
void BeginSongLoad() override
Start the song's track loader.
void Handle(const BtnEvent< 10 > &event) override
Ignore a button event of command 10.
Definition duel.h:157
@ kRuleSetDuel
Definition gamedb.h:33
Input event that plays a note on one of the three gem buttons.
Definition playnoteevent.h:10
Input event that rotates a player's view of the tracks by one track.
Definition rotateevent.h:11
Input event of an analog stick position.
Definition stickevent.h:15
World()
Construct a world with no game state.