575 void PollQuitEnding();
605 void BeginQuitEnding();
617 void StartClock(
int nTick);
651 std::vector<std::unique_ptr<GameEndedMsg>> mGameEndedMsgs;
652 std::vector<std::unique_ptr<PlayerAbortedMsg>> mPlayerAbortedMsgs;
653 std::unique_ptr<File> mDemoFile;
657 std::unique_ptr<WorldLogic> mLogic;
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
Reference-counted array of script data nodes.
Definition dataarray.h:20
Message that reports the end of an online session, with the final scores.
Definition gameendedmsg.h:23
Base of every event the game passes between a MsgSource and a MsgSink.
Definition message.h:40
Receiver of engine messages.
Definition msgsink.h:21
Input event that plays a note on one of the three gem buttons.
Definition playnoteevent.h:10
Message that reports a player leaving an online session.
Definition playerabortedmsg.h:20
Input event that rotates a player's view of the tracks by one track.
Definition rotateevent.h:11
Message that starts the song of an online session on every console.
Definition startgamemsg.h:20
Input event of an analog stick position.
Definition stickevent.h:15
Rules of one World, the base of the game, remix, and duel logic.
Definition worldlogic.h:28
virtual void Record(const BtnEvent< 3 > &event)
Record a button event of command 3.
virtual void Handle(const BtnEvent< 3 > &event)=0
Act on a button event of command 3 from the input router.
virtual void Handle(const PlayNoteEvent &event)=0
Act on a gem button from the input router.
virtual void Handle(const ChangeSectionEvent &event)=0
Act on a section change from the input router.
bool IsFreestyling(int nPlayer)
Report whether a player is in a freestyle while the song plays.
virtual bool IsSongLoadDone()=0
Report whether the first loading stage finished.
virtual void Handle(const RotateEvent &event)=0
Act on a rotation from the input router.
int mSeed
Definition world.h:523
virtual void Record(const BtnEvent< 8 > &event)
Record a button event of command 8.
LoadStep
Values of mLoadStep.
Definition world.h:44
@ kLoadStepSong
Definition world.h:46
@ kLoadStepDemo
Definition world.h:45
@ kLoadStepTracks
Definition world.h:47
@ kLoadStepSession
Definition world.h:50
@ kLoadStepMusic
Definition world.h:48
@ kLoadStepComplete
Definition world.h:51
@ kLoadStepAssets
Definition world.h:49
virtual void Handle(const StickEvent< 2 > &event)=0
Act on a stick event of command 2 from the input router.
virtual bool IsAssetLoadDone()=0
Report whether the second loading stage finished.
virtual void PollSongLoad()=0
Advance the first loading stage by one frame.
int GetTick()
Report the song position in ticks.
int IsRestartRequested()
Report whether the world that ended requested a restart.
virtual void Record(const StickEvent< 2 > &event)
Record a stick event of command 2.
float GetTime()
Report the song position on the song clock.
virtual void Handle(const BtnEvent< 10 > &event)=0
Act on a button event of command 10 from the input router.
virtual void Record(const BtnEvent< 4 > &event)
Record a button event of command 4.
virtual void Record(const BtnEvent< 9 > &event)
Record a button event of command 9.
virtual bool IsFinished()=0
Report whether the running world has ended.
virtual void Record(const ChangeSectionEvent &event)
Record a section change.
virtual int GetRuleSet() const =0
Report the rule set the world plays under.
virtual void BeginEnding()
Start the sequence that follows the end of the game.
Definition world.h:262
void LoadAssets()
Start loading the song and the assets of the world.
virtual void OnStart()
Finish starting the song, after Start() created the logic.
Definition world.h:403
void SetLogic(WorldLogic *pLogic)
Destroy the installed logic and install another.
virtual void Handle(const BtnEvent< 9 > &event)=0
Act on a button event of command 9 from the input router.
virtual void Record(const BtnEvent< 10 > &event)
Record a button event of command 10.
virtual void BeginSongLoad()=0
Start loading the song, the first loading stage.
virtual void BuildTracks(int nStartTick)=0
Build the track display for the song.
virtual void BeginAssetLoad()=0
Start loading the assets of the second loading stage.
bool DispatchPriv(Message *pMsg) override
Act on a message sent to the world.
virtual void Record(const StickEvent< 6 > &event)
Record a stick event of command 6.
virtual void Record(const BtnEvent< 5 > &event)
Record a button event of command 5.
std::unique_ptr< Song > mSong
Definition world.h:521
State
Values of mState.
Definition world.h:34
@ kStateLoaded
Definition world.h:37
@ kStatePlaying
Definition world.h:38
@ kStateEnding
Definition world.h:39
@ kStateLoading
Definition world.h:36
@ kStateIdle
Definition world.h:35
@ kStateRestarting
Definition world.h:40
void Start()
Start the song of a world that finished loading.
virtual void CreateLogic()=0
Build the WorldLogic of the rule set and install it with SetLogic().
bool IsLoaded() const
Report whether the assets LoadAssets() started are loaded.
DataArray * mSongConfig
Definition world.h:522
void Poll()
Advance the world by one frame.
virtual void Handle(const StickEvent< 6 > &event)=0
Act on a stick event of command 6 from the input router.
virtual float GetDisplayTime()
Report how far the running world has played, from WorldLogic::GetProgress().
virtual void Record(const RotateEvent &event)
Record a rotation as a serializable input command.
void Stop()
Stop the song and release what Start() and LoadAssets() created.
virtual void Handle(const BtnEvent< 4 > &event)=0
Act on a button event of command 4 from the input router.
~World() override
Release the world.
virtual bool IsEndingDone()
Report whether the sequence that follows the end of the game finished.
Definition world.h:285
virtual void Record(const PlayNoteEvent &event)
Record a gem button as a serializable input command.
virtual void PollEnding()
Advance the sequence that follows the end of the game by one frame.
Definition world.h:273
virtual void Handle(const BtnEvent< 5 > &event)=0
Act on a button event of command 5 from the input router.
World()
Construct a world with no game state.
virtual void Handle(const BtnEvent< 8 > &event)=0
Act on a button event of command 8 from the input router.
virtual void PollAssetLoad()=0
Advance the second loading stage by one frame.
WorldLogic * TheWorldLogic
The logic of the running world, which World::SetLogic() installs, or null.