struct -> class
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
#define ACTIVE_ATTACK_LIST_H
|
||||
|
||||
#include "BitmapText.h"
|
||||
struct PlayerState;
|
||||
class PlayerState;
|
||||
|
||||
class ActiveAttackList : public BitmapText
|
||||
{
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#ifndef ARROWEFFECTS_H
|
||||
#define ARROWEFFECTS_H
|
||||
|
||||
struct PlayerState;
|
||||
class PlayerState;
|
||||
|
||||
class ArrowEffects
|
||||
{
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "GameConstantsAndTypes.h"
|
||||
#include "PlayerNumber.h"
|
||||
class Song;
|
||||
struct PlayerState;
|
||||
class PlayerState;
|
||||
|
||||
struct Attack
|
||||
{
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include "GameConstantsAndTypes.h" // for TapNoteScore
|
||||
#include "RageTexturePreloader.h"
|
||||
|
||||
struct PlayerState;
|
||||
class PlayerState;
|
||||
|
||||
class AttackDisplay : public ActorFrame
|
||||
{
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
#include "BitmapText.h"
|
||||
#include "PlayerNumber.h"
|
||||
#include "ThemeMetric.h"
|
||||
struct PlayerState;
|
||||
struct PlayerStageStats;
|
||||
class PlayerState;
|
||||
class PlayerStageStats;
|
||||
|
||||
class Combo : public ActorFrame
|
||||
{
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
#include "ActorFrame.h"
|
||||
#include "PlayerNumber.h"
|
||||
|
||||
struct StageStats;
|
||||
struct PlayerStageStats;
|
||||
class StageStats;
|
||||
class PlayerStageStats;
|
||||
|
||||
class ComboGraph: public ActorFrame
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "HoldGhostArrow.h"
|
||||
#include "GameConstantsAndTypes.h"
|
||||
|
||||
struct PlayerState;
|
||||
class PlayerState;
|
||||
|
||||
class GhostArrowRow : public ActorFrame
|
||||
{
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
#include "RageTexture.h"
|
||||
#include "AutoActor.h"
|
||||
|
||||
struct StageStats;
|
||||
struct PlayerStageStats;
|
||||
class StageStats;
|
||||
class PlayerStageStats;
|
||||
|
||||
class GraphDisplay: public ActorFrame
|
||||
{
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include "PlayerNumber.h"
|
||||
#include "RageSound.h"
|
||||
|
||||
struct PlayerState;
|
||||
class PlayerState;
|
||||
|
||||
class Inventory : public Actor
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@ class Model;
|
||||
|
||||
struct HoldNoteResult;
|
||||
struct NoteMetricCache_t;
|
||||
struct PlayerState;
|
||||
class PlayerState;
|
||||
|
||||
#define NOTE_COLOR_IMAGES 8
|
||||
|
||||
|
||||
@@ -10,8 +10,9 @@ class Steps;
|
||||
struct lua_State;
|
||||
|
||||
|
||||
struct PlayerStageStats
|
||||
class PlayerStageStats
|
||||
{
|
||||
public:
|
||||
PlayerStageStats() { Init(); }
|
||||
void Init();
|
||||
|
||||
|
||||
@@ -8,11 +8,13 @@
|
||||
#include <map>
|
||||
#include "Attack.h"
|
||||
|
||||
struct PlayerState
|
||||
class PlayerState
|
||||
{
|
||||
public:
|
||||
PlayerState()
|
||||
{
|
||||
m_PlayerNumber = PLAYER_INVALID;
|
||||
m_mp = MultiPlayer_INVALID;
|
||||
Reset();
|
||||
}
|
||||
void Reset()
|
||||
@@ -51,6 +53,7 @@ struct PlayerState
|
||||
// in PlayerState and callers should not use PlayerNumber to index into
|
||||
// GameState.
|
||||
PlayerNumber m_PlayerNumber;
|
||||
MultiPlayer m_mp;
|
||||
|
||||
|
||||
PlayerOptions m_CurrentPlayerOptions; // current approaches destination
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "PlayerNumber.h"
|
||||
#include "GameConstantsAndTypes.h"
|
||||
|
||||
struct PlayerState;
|
||||
class PlayerState;
|
||||
|
||||
class ReceptorArrow : public ActorFrame
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "GameConstantsAndTypes.h"
|
||||
#include "NoteTypes.h"
|
||||
|
||||
struct PlayerState;
|
||||
class PlayerState;
|
||||
|
||||
class ReceptorArrowRow : public ActorFrame
|
||||
{
|
||||
|
||||
@@ -17,8 +17,8 @@ class NoteData;
|
||||
class Inventory;
|
||||
class Song;
|
||||
class Steps;
|
||||
struct PlayerState;
|
||||
struct PlayerStageStats;
|
||||
class PlayerState;
|
||||
class PlayerStageStats;
|
||||
|
||||
|
||||
class ScoreKeeper
|
||||
|
||||
@@ -414,7 +414,7 @@ void ScreenNameEntryTraditional::Init()
|
||||
SET_ON( display.m_DifficultyMeter );
|
||||
this->AddChild( &display.m_DifficultyMeter );
|
||||
|
||||
display.m_textScore.Load( p, &ss.m_player[p], "ScreenNameEntryTraditional Percent", false );
|
||||
display.m_textScore.Load( GAMESTATE->m_pPlayerState[p], &ss.m_player[p], "ScreenNameEntryTraditional Percent", false );
|
||||
display.m_textScore.SetName( ssprintf("ScoreP%i",p+1) );
|
||||
SET_ON( display.m_textScore );
|
||||
this->AddChild( &display.m_textScore );
|
||||
|
||||
@@ -36,6 +36,21 @@ void StageStats::AssertValid( PlayerNumber pn ) const
|
||||
ASSERT( vpPossibleSongs.size() == m_player[pn].vpPossibleSteps.size() );
|
||||
}
|
||||
|
||||
void StageStats::AssertValid( MultiPlayer pn ) const
|
||||
{
|
||||
ASSERT( vpPlayedSongs.size() != 0 );
|
||||
ASSERT( vpPossibleSongs.size() != 0 );
|
||||
if( vpPlayedSongs[0] )
|
||||
CHECKPOINT_M( vpPlayedSongs[0]->GetTranslitFullTitle() );
|
||||
ASSERT( m_multiPlayer[pn].vpPlayedSteps.size() != 0 );
|
||||
ASSERT( m_multiPlayer[pn].vpPlayedSteps[0] );
|
||||
ASSERT_M( playMode < NUM_PLAY_MODES, ssprintf("playmode %i", playMode) );
|
||||
ASSERT( pStyle != NULL );
|
||||
ASSERT_M( m_player[pn].vpPlayedSteps[0]->GetDifficulty() < NUM_DIFFICULTIES, ssprintf("difficulty %i", m_player[pn].vpPlayedSteps[0]->GetDifficulty()) );
|
||||
ASSERT( vpPlayedSongs.size() == m_player[pn].vpPlayedSteps.size() );
|
||||
ASSERT( vpPossibleSongs.size() == m_player[pn].vpPossibleSteps.size() );
|
||||
}
|
||||
|
||||
|
||||
int StageStats::GetAverageMeter( PlayerNumber pn ) const
|
||||
{
|
||||
@@ -65,13 +80,13 @@ void StageStats::AddStats( const StageStats& other )
|
||||
fGameplaySeconds += other.fGameplaySeconds;
|
||||
fStepsSeconds += other.fStepsSeconds;
|
||||
|
||||
FOREACH_PlayerNumber( p )
|
||||
FOREACH_EnabledMultiPlayer( p )
|
||||
m_player[p].AddStats( other.m_player[p] );
|
||||
}
|
||||
|
||||
bool StageStats::OnePassed() const
|
||||
{
|
||||
FOREACH_HumanPlayer( p )
|
||||
FOREACH_EnabledMultiPlayer( p )
|
||||
if( !m_player[p].bFailed )
|
||||
return true;
|
||||
return false;
|
||||
@@ -79,7 +94,7 @@ bool StageStats::OnePassed() const
|
||||
|
||||
bool StageStats::AllFailed() const
|
||||
{
|
||||
FOREACH_EnabledPlayer( pn )
|
||||
FOREACH_EnabledMultiPlayer( pn )
|
||||
if( !m_player[pn].bFailed )
|
||||
return false;
|
||||
return true;
|
||||
@@ -87,7 +102,7 @@ bool StageStats::AllFailed() const
|
||||
|
||||
bool StageStats::AllFailedEarlier() const
|
||||
{
|
||||
FOREACH_EnabledPlayer( p )
|
||||
FOREACH_EnabledMultiPlayer( p )
|
||||
if( !m_player[p].bFailedEarlier )
|
||||
return false;
|
||||
return true;
|
||||
|
||||
@@ -10,12 +10,14 @@ class Style;
|
||||
struct lua_State;
|
||||
|
||||
|
||||
struct StageStats
|
||||
class StageStats
|
||||
{
|
||||
public:
|
||||
StageStats();
|
||||
void Init();
|
||||
|
||||
void AssertValid( PlayerNumber pn ) const;
|
||||
void AssertValid( MultiPlayer mp ) const;
|
||||
|
||||
void AddStats( const StageStats& other ); // accumulate
|
||||
|
||||
@@ -40,6 +42,7 @@ struct StageStats
|
||||
float GetTotalPossibleStepsSeconds() const; // TODO: Scale this by the music rate
|
||||
|
||||
PlayerStageStats m_player[NUM_PLAYERS];
|
||||
PlayerStageStats m_multiPlayer[NUM_MultiPlayer];
|
||||
|
||||
// Lua
|
||||
void PushSelf( lua_State *L );
|
||||
|
||||
@@ -46,15 +46,22 @@ StageStats AccumStageStats( const vector<StageStats>& vss )
|
||||
* and the rest, which are counters. */
|
||||
// FIXME: Weight each song by the number of stages it took to account for
|
||||
// long, marathon.
|
||||
FOREACH_EnabledPlayer( pn )
|
||||
FOREACH_EnabledPlayer( p )
|
||||
{
|
||||
for( int r = 0; r < RADAR_NUM_TAPS_AND_HOLDS; r++)
|
||||
{
|
||||
ssreturn.m_player[pn].radarPossible[r] /= uNumSongs;
|
||||
ssreturn.m_player[pn].radarActual[r] /= uNumSongs;
|
||||
ssreturn.m_player[p].radarPossible[r] /= uNumSongs;
|
||||
ssreturn.m_player[p].radarActual[r] /= uNumSongs;
|
||||
}
|
||||
}
|
||||
FOREACH_EnabledMultiPlayer( p )
|
||||
{
|
||||
for( int r = 0; r < RADAR_NUM_TAPS_AND_HOLDS; r++)
|
||||
{
|
||||
ssreturn.m_multiPlayer[p].radarPossible[r] /= uNumSongs;
|
||||
ssreturn.m_multiPlayer[p].radarActual[r] /= uNumSongs;
|
||||
}
|
||||
}
|
||||
|
||||
return ssreturn;
|
||||
}
|
||||
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
|
||||
void Style::GetTransformedNoteDataForStyle( PlayerNumber pn, const NoteData& original, NoteData& noteDataOut ) const
|
||||
{
|
||||
ASSERT( pn >=0 && pn <= NUM_PLAYERS );
|
||||
|
||||
int iNewToOriginalTrack[MAX_COLS_PER_PLAYER];
|
||||
for( int col=0; col<m_iColsPerPlayer; col++ )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user