Etterna 0.74.4
Loading...
Searching...
No Matches
PlayerState.h
1
3#ifndef PlayerState_H
4#define PlayerState_H
5
6#include "ModsGroup.h"
7#include "PlayerNumber.h"
8#include "PlayerOptions.h"
9#include "SampleHistory.h"
10#include "Etterna/Models/Songs/SongPosition.h"
11
12struct lua_State;
13
15{
16 float beat;
17 float displayedBeat;
18 float velocity;
19};
20
22{
23 float beat;
24 int notesLower;
25 int notesUpper;
26};
27
30{
31 public:
34
36 void Reset();
40 void Update(float fDelta);
41
42 void SetPlayerNumber(PlayerNumber pn);
43 void ResetCacheInfo(/*const NoteData& notes*/);
44
51 PlayerNumber m_PlayerNumber;
55 MultiPlayer m_mp;
56
57 // This is used by ArrowEffects and the NoteField to zoom both appropriately
58 // to fit in the space available. -Kyz
59 float m_NotefieldZoom;
60
61 auto GetDisplayedTiming() const -> const TimingData&;
62
71
78
83 void ResetToDefaultPlayerOptions(ModsLevel l);
86
91 mutable float m_fLastDrawnBeat;
93 HealthState m_HealthState;
94
96 PlayerController m_PlayerController;
97
98 SampleHistory m_EffectHistory;
99
100 int m_iCpuSkill; // only used when m_PlayerController is PC_CPU
101
102 // Stores the bpm that was picked for reading the chart if the player is
103 // using an mmod.
104 float m_fReadBPM;
105
106 bool m_bGoalTrackerUsesReplay = false;
107
108 /* why is the slow getstyles function called every time to get
109 number of columns in places where it can't change? - Mina */
110 int m_NumCols;
111 void SetNumCols(int ncol) { m_NumCols = ncol; };
112 auto GetNumCols() -> int { return m_NumCols; };
113
114 float playertargetgoal = 0.93F;
115
116 // Lua
117 void PushSelf(lua_State* L);
118};
119
120#endif
Definition ModsGroup.h:44
Per-player options that are not saved between sessions.
Definition PlayerOptions.h:48
The player's indivdual state.
Definition PlayerState.h:30
MultiPlayer m_mp
The MultiPlayer number assigned to this Player, typically 1-32.
Definition PlayerState.h:55
ModsGroup< PlayerOptions > m_PlayerOptions
The PlayerOptions presently in use by the Player.
Definition PlayerState.h:85
void Update(float fDelta)
Update the PlayerState based on the present time.
Definition PlayerState.cpp:36
PlayerState()
Set up the PlayerState with initial values.
Definition PlayerState.cpp:8
void Reset()
Reset the PlayerState with the initial values.
Definition PlayerState.cpp:16
HealthState m_HealthState
The Player's HealthState in general terms.
Definition PlayerState.h:93
PlayerNumber m_PlayerNumber
The PlayerNumber assigned to this Player: usually 1 or 2.
Definition PlayerState.h:51
PlayerController m_PlayerController
The type of person/machine controlling the Player.
Definition PlayerState.h:96
std::vector< CacheDisplayedBeat > m_CacheDisplayedBeat
Holds a vector sorted by real beat, the beat that would be displayed in the NoteField (because they a...
Definition PlayerState.h:70
void ResetToDefaultPlayerOptions(ModsLevel l)
Change the PlayerOptions to their default.
Definition PlayerState.cpp:53
std::vector< CacheNoteStat > m_CacheNoteStat
Holds a vector sorted by beat, the cumulative number of notes from the start of the song....
Definition PlayerState.h:77
float m_fLastDrawnBeat
Used to push note-changing modifiers back so that notes don't pop.
Definition PlayerState.h:91
Store a trailing history of values, and retrieve values with interpolation.
Definition SampleHistory.h:6
Holds data for translating beats<->seconds.
Definition TimingData.h:54
Definition PlayerState.h:15
Definition PlayerState.h:22