437 return mTime[mClock];
447 return mTime[nClock];
487 return mCapturer[nTrack];
507 return mDying[nPlayer];
522 return mHealth[nPlayer];
532 return mInstrument[nPlayer];
547 return mMode[nPlayer];
552 return mOldComponent;
592 return mScore[nPlayer];
607 return mStreak[nPlayer];
617 return mTrack[nPlayer];
621 std::vector<TriggerEvent> mEvents;
622 std::list<TriggerAction *> mRunning;
624 std::list<std::pair<TriggerAction *, float>> mScheduled[
kNumClocks];
653 std::vector<bool> mPaths;
const int kNumPlayers
Number of players.
Definition Joypad.h:12
Stream of raw bytes, the base of the memory, file, and network streams.
Definition binstream.h:22
Reference-counted array of script data nodes.
Definition dataarray.h:20
Growable text buffer that is also a PrnStream.
Definition string.h:19
Something a trigger does when its conditions hold.
Definition triggeraction.h:15
Registry of the triggers that fire actions on game and display events.
Definition triggermgr.h:28
void ScoreEvent(int nPlayer, int nScore)
Fire the triggers that wait on a new score.
void PathUnlockedEvent(int nPath)
Fire the triggers that wait on a path being unlocked.
const String & GetScreen() const
Definition triggermgr.h:596
@ kNumTracks
Definition triggermgr.h:41
@ kNumPlayers
Definition triggermgr.h:39
@ kNoPlayer
Definition triggermgr.h:40
void AddTriggers(DataArray *pTriggers)
Register the triggers of an array, each with the event its node 0 names.
void ButtonEvent(int nPlayer, int nButtons)
Fire the triggers that wait on a button.
void ComponentFocusEvent(const char *pszComponent, const char *pszPanel, const char *pszScreen)
Fire the triggers that wait on the focus arriving at a component, with no previous component.
void EndEvent(int nState, int nPlayer)
Fire the triggers that wait on the end of the game.
int GetPowerup() const
Definition triggermgr.h:571
const String & GetPanel() const
Definition triggermgr.h:566
void ComponentSelectEvent(UIComponentSelectMsg *pMsg)
Fire the triggers that wait on a component being chosen.
const String & GetComponent() const
Definition triggermgr.h:491
int GetGemPos() const
Definition triggermgr.h:461
void ComponentSelectStartEvent(UIComponentSelectStartMsg *pMsg)
Fire the triggers that wait on the choice of a component beginning.
int GetScore(int nPlayer) const
Report the score of a player.
Definition triggermgr.h:591
void PhraseMissEvent(int nPlayer)
Fire the triggers that wait on a missed phrase.
void HitEvent(int nPlayer, int nGemPos)
Fire the triggers that wait on a player hitting a gem.
float GetDistance() const
Definition triggermgr.h:496
void BeginEvent(int nRuleSet)
Fire the triggers that wait on the begin event.
void PhraseCaptureEvent(int nPlayer, int nStreak)
Fire the triggers that wait on a player capturing a phrase.
int GetCapturer(int nTrack) const
Report the player who captured a track.
Definition triggermgr.h:486
void MetagameEvent(float flStart, float flTime, float flValue)
Advance the clocks and fire the triggers that wait on the time.
void DyingEvent(int nPlayer, int nDying)
Fire the triggers that wait on a player starting or stopping dying.
const String & GetLyric() const
Definition triggermgr.h:466
void NewBarEvent(int nBar)
Fire the triggers that wait on the start of a bar.
bool IsPathUnlocked(unsigned int nPath) const
Report whether a path exists and is unlocked.
int GetDying(int nPlayer) const
Report whether a player is dying.
Definition triggermgr.h:506
int GetBar() const
Definition triggermgr.h:471
void NewTrackEvent(int nPlayer, int nTrack, int nInstrument, int nMode)
Fire the triggers that wait on a player moving to a new track.
int GetGameState() const
Definition triggermgr.h:511
const String & GetOldPanel() const
Definition triggermgr.h:556
bool PathExists(unsigned int nPath) const
Report whether a path exists.
int GetStreak(int nPlayer) const
Report the phrase streak of a player.
Definition triggermgr.h:606
void MissEvent(int nPlayer, int nGemPos)
Fire the triggers that wait on a player missing a gem.
void AddRunning(TriggerAction *pAction)
Poll an action every frame until it reports itself done.
~TriggerMgr()
Release every trigger.
int GetHealth(int nPlayer) const
Report the health of a player.
Definition triggermgr.h:521
void GemEvent(int nTrack, int nGemPos)
Fire the triggers that wait on a gem of a captured track.
void Poll()
Run the actions whose time has come, and poll the running actions.
const String & GetOldComponent() const
Definition triggermgr.h:551
char GetNote() const
Definition triggermgr.h:456
int GetTrack(int nPlayer) const
Report the track of a player.
Definition triggermgr.h:616
int GetRuleSet() const
Definition triggermgr.h:581
int GetLeader() const
Definition triggermgr.h:536
void Load(const char *pszFile, BinStream *pStream)
Read triggers from a data file and register them.
float GetTime(int nClock) const
Report the time of a clock.
Definition triggermgr.h:446
int GetPlayer() const
Definition triggermgr.h:451
int GetButtons() const
Definition triggermgr.h:476
void Terminate()
Release every registered trigger.
void StageCompleteEvent(int nPlayer)
Fire the triggers that wait on a player completing a stage.
float GetRandom() const
Definition triggermgr.h:576
void HealthEvent(int nPlayer, int nHealth)
Fire the triggers that wait on a change of health.
void SetClock(int nClock)
Set the clock of the action in progress.
Definition triggermgr.h:431
TriggerMgr()
Construct the registry with an empty event of each kind.
void Init()
Read the "trigger" section of the configuration.
void BossJourneyEvent()
Fire the triggers that wait on the boss journey starting.
void ScreenChangeEvent(UIScreenChangeMsg *pMsg)
Fire the triggers that wait on a move between screens.
float GetCurrentTime() const
Definition triggermgr.h:436
int GetInstrument(int nPlayer) const
Report the instrument of the track of a player.
Definition triggermgr.h:531
int GetMode(int nPlayer) const
Report the music mode of the track of a player.
Definition triggermgr.h:546
Clock
The clocks an action runs on, the indices of mTime.
Definition triggermgr.h:31
@ kClockReal
Definition triggermgr.h:33
@ kNumClocks
Definition triggermgr.h:34
@ kClockGame
Definition triggermgr.h:32
const String & GetOldScreen() const
Definition triggermgr.h:561
void LyricEvent(const char *pszLyric)
Fire the triggers that wait on a lyric.
void SetPaths(const std::vector< bool > &paths)
Record which paths of the arena are unlocked.
int GetClock() const
Definition triggermgr.h:422
void ComponentFocusEvent(UIComponentFocusChangeMsg *pMsg)
Fire the triggers that wait on the focus moving between components.
void BeatEvent(char chNote)
Fire the triggers that wait on a note of the background music.
void Schedule(TriggerAction *pAction, float flDelay)
Schedule an action to run after a delay on the current clock.
void PhraseEndEvent(int nTrack)
Fire the triggers that wait on the end of a phrase.
Message a panel sends before it moves its focus to another component.
Definition uicomponentfocuschangemsg.h:26
Message a component sends when the player chooses it.
Definition uicomponentselectmsg.h:28
Message a component sends when the player presses the button that chooses it.
Definition uicomponentselectstartmsg.h:27
Message UIManager sends before it leaves the current screen for another.
Definition uiscreenchangemsg.h:24
TriggerMgr TheTriggerMgr
The trigger registry.