GetPlayerInfoForInput allows mapping inputs to PlayerInfos rather than just PlayerNumbers to PlayerInfos.

This commit is contained in:
Steve Checkoway
2006-07-09 20:14:06 +00:00
parent 025997d453
commit 4a324be6dd
2 changed files with 3 additions and 4 deletions
+1 -2
View File
@@ -47,7 +47,6 @@
#include "Player.h" #include "Player.h"
#include "DifficultyIcon.h" #include "DifficultyIcon.h"
#include "DifficultyMeter.h" #include "DifficultyMeter.h"
#include "InputEventPlus.h"
#include "XmlFile.h" #include "XmlFile.h"
#include "Background.h" #include "Background.h"
#include "Foreground.h" #include "Foreground.h"
@@ -2194,7 +2193,7 @@ void ScreenGameplay::Input( const InputEventPlus &input )
if( PREFSMAN->m_AutoPlay == PC_HUMAN ) if( PREFSMAN->m_AutoPlay == PC_HUMAN )
{ {
PlayerInfo& pi = PlayerNumberToPlayerInfo( input.StyleI.player ); PlayerInfo& pi = GetPlayerInfoForInput( input );
pi.m_pPlayer->Step( input.StyleI.col, input.DeviceI.ts ); pi.m_pPlayer->Step( input.StyleI.col, input.DeviceI.ts );
} }
} }
+2 -2
View File
@@ -17,7 +17,7 @@
#include "ThemeMetric.h" #include "ThemeMetric.h"
#include "PlayerStageStats.h" #include "PlayerStageStats.h"
#include "PlayerState.h" #include "PlayerState.h"
#include "GameInput.h" #include "InputEventPlus.h"
class LyricsLoader; class LyricsLoader;
class ActiveAttackList; class ActiveAttackList;
@@ -221,7 +221,7 @@ protected:
vector<PlayerInfo> m_vPlayerInfo; // filled by SGameplay derivatives in Init vector<PlayerInfo> m_vPlayerInfo; // filled by SGameplay derivatives in Init
virtual void FillPlayerInfo( vector<PlayerInfo> &vPlayerInfoOut ) = 0; virtual void FillPlayerInfo( vector<PlayerInfo> &vPlayerInfoOut ) = 0;
virtual PlayerInfo &PlayerNumberToPlayerInfo( PlayerNumber pn ) { return m_vPlayerInfo[pn]; } virtual PlayerInfo &GetPlayerInfoForInput( const InputEventPlus& iep ) { return m_vPlayerInfo[iep.StyleI.player]; }
}; };
vector<PlayerInfo>::iterator GetNextEnabledPlayerInfo ( vector<PlayerInfo>::iterator iter, vector<PlayerInfo> &v ); vector<PlayerInfo>::iterator GetNextEnabledPlayerInfo ( vector<PlayerInfo>::iterator iter, vector<PlayerInfo> &v );