|
wavelength 1.0.0
|
Rules of the duel rule set. More...
#include <duellogic.h>


Classes | |
| struct | BarData |
| The data the duel records for each bar of the song. More... | |
Public Types | |
| enum | State { kStateNone = 0 , kStatePlaying = 1 , kStatePaused = 2 , kStateDecided = 3 , kStateEnding = 4 , kStateFinished = 5 } |
| Values of mState. More... | |
| enum | Phase { kPhasePitch = 0 , kPhaseCatch = 1 , kPhaseBreak = 2 } |
| Values of mPhase and mCuePhase. More... | |
Public Member Functions | |
| DuelLogic (Song *pSong) | |
| Construct the rules for a song. | |
| ~DuelLogic () override | |
| Release the rules. | |
| bool | DispatchPriv (Message *pMsg) override |
| Act on a message sent to the rules. | |
| void | Start () override |
| Start the music, set the first roles, and schedule the commands of the duel. | |
| void | Stop () override |
| End the duel. | |
| bool | IsFinished () const override |
| Report whether the duel ended. | |
| int | HasQuit () const override |
| Report whether a player abandoned the duel from a menu. | |
| int | IsRestartRequested () const override |
| Report that no restart was requested. | |
| bool | IsFreestyling (int nPlayer) override |
| Report that no player freestyles. | |
| int | GetTick () override |
| Report the song position in ticks. | |
| float | GetTime () override |
| Report the song position on the song clock. | |
| void | Poll () override |
| Finish the duel once the song has faded out and the outro is done. | |
| float | GetProgress () override |
| Report the fraction of the song played. | |
| void | HandleInput (const RotateEvent &event) override |
| Ignore a rotation. | |
| void | HandleInput (const PlayNoteEvent &event) override |
| Hand a gem button to the player who pressed it while the song plays. | |
| void | HandleInput (const BtnEvent< 3 > &event) override |
| Pause the duel while the song plays. | |
| void | HandleInput (const BtnEvent< 4 > &event) override |
| Ignore a button event of command 4. | |
| void | HandleInput (const BtnEvent< 5 > &event) override |
| Ignore a button event of command 5. | |
| void | HandleInput (const ChangeSectionEvent &event) override |
| Ignore a section change. | |
| void | HandleInput (const BtnEvent< 9 > &event) override |
| Ignore a button event of command 9. | |
| void | HandleInput (const BtnEvent< 10 > &event) override |
| Ignore a button event of command 10. | |
| void | HandleInput (const BtnEvent< 8 > &event) override |
| Ignore a button event of command 8. | |
| void | HandleInput (const StickEvent< 2 > &event) override |
| Ignore a stick event of command 2. | |
| void | HandleInput (const StickEvent< 6 > &event) override |
| Ignore a stick event of command 6. | |
| void | SetPaused (bool bPaused, int nPad, int nReason) override |
| Pause or resume the duel. | |
| bool | IsPlaying () const override |
| Report whether the song plays. | |
| int | GetBarInstrument (int nBar) |
| Report the instrument of the song track the duel plays in a bar. | |
| int | GetPlayerSide (int nPlayer) const |
| Report the side of a player. | |
| void | StartEnding () |
| Fade the song out and schedule the end of the duel. | |
| void | OnCatchMissed (DuelTrack *pTrack, Player *pPlayer, int nBar) |
| Score a missed catch for the pitcher. | |
| void | OnCatchMade (DuelTrack *pTrack, Player *pPlayer, bool bReact) |
| Score a made catch for the catcher. | |
| void | RewindCatcherTrack () |
| Move the playback of the catcher's track to the current song position. | |
| Public Member Functions inherited from WorldLogic | |
| WorldLogic () | |
| Construct the logic and give the input of every controller to the world. | |
| ~WorldLogic () override | |
| Release the logic. | |
| bool | DispatchPriv (Message *pMsg) override |
| Pass a JoypadConnectionMsg to OnJoypadConnection() and ignore any other message. | |
| void | AllNotesOff () |
| Silence every synthesiser channel. | |
| void | ScheduleControllerCheck () |
| Pause the song again one tick from now when a controller is disconnected. | |
| int | OnJoypadConnection (JoypadConnectionMsg *pMsg) |
| Pause the playing song when the controller of a player is disconnected. | |
| Public Member Functions inherited from MsgSink | |
| void * | operator new (size_t nSize) |
| Allocate a sink from the pool heaps under the tag "MsgSink". | |
| void | operator delete (void *pBlock) |
| Return a sink to the pool heaps. | |
| virtual | ~MsgSink () |
| virtual bool | Dispatch (Message *pMsg) |
| Accept a message. | |
| void * | operator new (size_t size) |
| Allocate from the main heap under the name MsgSink. | |
| void | operator delete (void *mem) |
| Return memory to its heap. | |
| virtual | ~MsgSink () |
| Destroy the sink. | |
| virtual bool | Dispatch (Message *msg) |
| Handle a message. | |
Additional Inherited Members | |
| Static Public Member Functions inherited from WorldLogic | |
| static int | FindDisconnectedPad () |
| Find the controller of a player on this console that is disconnected. | |
Rules of the duel rule set.
The RTTI records the class as deriving from WorldLogic. The object is 0x13c bytes. Two players take turns. The pitcher lays down a phrase of mPhraseBars bars on a DuelTrack, and the catcher then repeats it. A miss scores a point for the pitcher and a catch scores a point for the catcher, and the roles change after every catch phase. The duel is decided once a player has nine points, unless the score stands at nine to eight. Every routine name other than those of the WorldLogic overrides is inferred.
| enum DuelLogic::State |
| enum DuelLogic::Phase |
|
explicit |
Construct the rules for a song.
| pSong | The song the duel plays. |
|
override |
Release the rules.
|
overridevirtual |
Act on a message sent to the rules.
The packets and messages of an online duel go to the handlers below, and every other message goes to WorldLogic::DispatchPriv().
| pMsg | The message. |
Implements MsgSink.
|
overridevirtual |
Start the music, set the first roles, and schedule the commands of the duel.
Implements WorldLogic.
|
overridevirtual |
End the duel.
Implements WorldLogic.
|
overridevirtual |
Report whether the duel ended.
Implements WorldLogic.
|
overridevirtual |
Report whether a player abandoned the duel from a menu.
Implements WorldLogic.
|
inlineoverridevirtual |
Report that no restart was requested.
The body returns zero.
Implements WorldLogic.
|
inlineoverridevirtual |
Report that no player freestyles.
The body returns false.
| nPlayer | The player. |
Implements WorldLogic.
|
overridevirtual |
Report the song position in ticks.
Implements WorldLogic.
|
overridevirtual |
Report the song position on the song clock.
Implements WorldLogic.
|
overridevirtual |
Finish the duel once the song has faded out and the outro is done.
Implements WorldLogic.
|
overridevirtual |
Report the fraction of the song played.
Implements WorldLogic.
|
overridevirtual |
Ignore a rotation.
The body is empty.
| event | The rotation. |
Implements WorldLogic.
|
overridevirtual |
Hand a gem button to the player who pressed it while the song plays.
| event | The button. |
Implements WorldLogic.
|
overridevirtual |
Pause the duel while the song plays.
| event | The button. |
Implements WorldLogic.
|
overridevirtual |
Ignore a button event of command 4.
The body is empty.
| event | The button. |
Implements WorldLogic.
|
overridevirtual |
Ignore a button event of command 5.
The body is empty.
| event | The button. |
Implements WorldLogic.
|
inlineoverridevirtual |
Ignore a section change.
The body is empty.
| event | The section change. |
Implements WorldLogic.
|
inlineoverridevirtual |
Ignore a button event of command 9.
The body is empty.
| event | The button. |
Implements WorldLogic.
|
inlineoverridevirtual |
Ignore a button event of command 10.
The body is empty.
| event | The button. |
Implements WorldLogic.
|
inlineoverridevirtual |
Ignore a button event of command 8.
The body is empty.
| event | The button. |
Implements WorldLogic.
|
overridevirtual |
Ignore a stick event of command 2.
The body is empty.
| event | The stick position. |
Implements WorldLogic.
|
overridevirtual |
Ignore a stick event of command 6.
The body is empty.
| event | The stick position. |
Implements WorldLogic.
|
overridevirtual |
Pause or resume the duel.
Pausing opens the pause menu, which stops the song clock unless the duel is online.
| bPaused | Whether the duel pauses. |
| nPad | The controller that paused the duel, or -1. |
| nReason | Non-zero when a disconnected controller paused the duel. |
Reimplemented from WorldLogic.
|
inlineoverridevirtual |
Report whether the song plays.
Implements WorldLogic.
| int DuelLogic::GetBarInstrument | ( | int | nBar | ) |
Report the instrument of the song track the duel plays in a bar.
| nBar | The bar. |
| int DuelLogic::GetPlayerSide | ( | int | nPlayer | ) | const |
Report the side of a player.
| nPlayer | The player. |
| void DuelLogic::StartEnding | ( | ) |
Fade the song out and schedule the end of the duel.
The outro of the display plays unless a player quit. The duel is ended at once from the pause menu.
Score a missed catch for the pitcher.
Only the first miss or catch of a phrase counts.
| pTrack | The track of the catcher. |
| pPlayer | The player whose console reported the miss. |
| nBar | The bar the catch phase started in. |
Score a made catch for the catcher.
| pTrack | The track of the catcher. |
| pPlayer | The player whose console reported the catch. |
| bReact | Whether the duel may play a sound that praises the catch. |
| void DuelLogic::RewindCatcherTrack | ( | ) |
Move the playback of the catcher's track to the current song position.