Etterna 0.74.4
Loading...
Searching...
No Matches
PlayerInfo.h
1#ifndef PLAYERINFO_H
2#define PLAYERINFO_H
3
4#include "Etterna/Models/Misc/GameConstantsAndTypes.h"
5#include "Etterna/Models/Misc/PlayerNumber.h"
6#include "Etterna/Models/StepsAndStyles/Steps.h"
7#include "Etterna/Models/Misc/PlayerStageStats.h"
8#include "Etterna/Actor/Base/BitmapText.h"
9#include "Etterna/Models/Misc/SoundEffectControl.h"
10#include "Etterna/Models/NoteData/NoteData.h"
11
12class Player;
13
14class LifeMeter;
15class StepsDisplay;
16class ScoreKeeper;
17
19{
20 public:
21 PlayerInfo();
23
24 void Load(PlayerNumber pn,
25 MultiPlayer mp,
26 bool bShowNoteField,
27 int iAddToDifficulty,
28 GameplayMode mode = GameplayMode_Normal);
29
35 {
36 return m_pn == PLAYER_INVALID ? m_mp : static_cast<MultiPlayer>(m_pn);
37 }
38 PlayerState* GetPlayerState();
39 PlayerStageStats* GetPlayerStageStats();
40 PlayerNumber GetStepsAndTrailIndex()
41 {
42 return m_pn == PLAYER_INVALID ? PLAYER_1 : m_pn;
43 }
47 bool IsEnabled();
51 bool IsMultiPlayer() const { return m_mp != MultiPlayer_Invalid; }
55 std::string GetName() const
56 {
57 if (m_bIsDummy)
58 return ssprintf("PlayerInfoDummy");
59 if (IsMultiPlayer())
60 return MultiPlayerToString(m_mp);
61 else
62 return PlayerNumberToString(m_pn);
63 }
64
65 // Lua
66 void PushSelf(lua_State* L);
67
69 PlayerNumber m_pn;
71 MultiPlayer m_mp{ MultiPlayer_Invalid };
72 bool m_bIsDummy{ false };
73 int m_iAddToDifficulty{ 0 }; // if > 0, use the Nth harder Steps
74 bool m_bPlayerEnabled{ false }; // IsEnabled cache for iterators
75 SoundEffectControl m_SoundEffectControl;
76
81 std::vector<Steps*> m_vpStepsQueue;
82
91
96
97 StepsDisplay* m_pStepsDisplay;
98};
99
100#endif
An actor that holds a Font and draws text to the screen.
Definition BitmapText.h:11
The player's life.
Definition LifeMeter.h:13
Holds data about the notes that the player is supposed to hit.
Definition NoteData.h:43
Definition PlayerInfo.h:19
BitmapText * m_ptextStepsDescription
The description of the current Steps.
Definition PlayerInfo.h:86
std::string GetName() const
Retrieve the name of the Player based on the mode.
Definition PlayerInfo.h:55
LifeMeter * m_pLifeMeter
The LifeMeter showing a Player's health.
Definition PlayerInfo.h:84
bool IsMultiPlayer() const
Determine if we're in MultiPlayer.
Definition PlayerInfo.h:51
MultiPlayer m_mp
The present Player's multiplayer number.
Definition PlayerInfo.h:71
bool IsEnabled()
Determine if the player information is enabled.
Definition PlayerInfo.cpp:95
BitmapText * m_ptextPlayerOptions
The current PlayerOptions that are activated.
Definition PlayerInfo.h:90
std::vector< Steps * > m_vpStepsQueue
The list of Steps a player has to go through in this set.
Definition PlayerInfo.h:81
Player * m_pPlayer
The specific Player that is going to play.
Definition PlayerInfo.h:95
ScoreKeeper * m_pPrimaryScoreKeeper
The primary ScoreKeeper for keeping track of the score.
Definition PlayerInfo.h:88
NoteData m_NoteData
The NoteData the Player has to get through.
Definition PlayerInfo.h:93
PlayerNumber m_pn
The present Player's number.
Definition PlayerInfo.h:69
MultiPlayer GetPlayerStateAndStageStatsIndex()
Retrieve the player's state and stage stats index.
Definition PlayerInfo.h:34
Contains statistics for one stage of play - either one song, or a whole course.
Definition PlayerStageStats.h:19
The player's indivdual state.
Definition PlayerState.h:30
Accepts input, knocks down TapNotes that were stepped on, and keeps score for the player.
Definition Player.h:42
Abstract class to handle scorekeeping, stat-taking, etc.
Definition ScoreKeeper.h:20
Control a sound property through user input.
Definition SoundEffectControl.h:11
A graphical representation of a Steps or a Trail.
Definition StepsDisplay.h:19