Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

Player.h

Go to the documentation of this file.
00001 /* Player - Accepts input, knocks down TapNotes that were stepped on, and keeps score for the player. */ 00002 00003 #ifndef PLAYER_H 00004 #define PLAYER_H 00005 00006 #include "ActorFrame.h" 00007 #include "Judgment.h" 00008 #include "HoldJudgment.h" 00009 #include "Combo.h" 00010 #include "NoteDataWithScoring.h" 00011 #include "RageSound.h" 00012 #include "AttackDisplay.h" 00013 #include "NoteData.h" 00014 00015 class ScoreDisplay; 00016 class LifeMeter; 00017 class CombinedLifeMeter; 00018 class ScoreKeeper; 00019 class Inventory; 00020 class RageTimer; 00021 class NoteField; 00022 struct PlayerStageStats; 00023 00024 #define SAMPLE_COUNT 16 00025 00026 class Player: public ActorFrame 00027 { 00028 public: 00029 Player(); 00030 ~Player(); 00031 00032 virtual void Update( float fDeltaTime ); 00033 virtual void DrawPrimitives(); 00034 00035 void Init( 00036 PlayerState* pPlayerState, 00037 PlayerStageStats* pPlayerStageStats, 00038 LifeMeter* pLM, 00039 CombinedLifeMeter* pCombinedLM, 00040 ScoreDisplay* pScoreDisplay, 00041 ScoreDisplay* pSecondaryScoreDisplay, 00042 Inventory* pInventory, 00043 ScoreKeeper* pPrimaryScoreKeeper, 00044 ScoreKeeper* pSecondaryScoreKeeper ); 00045 void Load( const NoteData& noteData ); 00046 void CrossedRow( int iNoteRow ); 00047 void CrossedMineRow( int iNoteRow ); 00048 void Step( int col, const RageTimer &tm ); 00049 void RandomizeNotes( int iNoteRow ); 00050 void FadeToFail(); 00051 int GetDancingCharacterState() const { return m_iDCState; }; 00052 void SetCharacterState(int iDCState) { m_iDCState = iDCState; }; 00053 void ApplyWaitingTransforms(); 00054 00055 static float GetMaxStepDistanceSeconds(); 00056 00057 void CacheAllUsedNoteSkins( bool bDeleteUnused ); 00058 00059 NoteData m_NoteData; 00060 00061 protected: 00062 void UpdateTapNotesMissedOlderThan( float fMissIfOlderThanThisBeat ); 00063 void OnRowCompletelyJudged( int iStepIndex ); 00064 void HandleTapRowScore( unsigned row ); 00065 void HandleHoldScore( HoldNoteScore holdScore, TapNoteScore tapScore ); 00066 void HandleAutosync(float fNoteOffset); 00067 void DrawTapJudgments(); 00068 void DrawHoldJudgments(); 00069 00070 int GetClosestNoteDirectional( int col, int iStartRow, int iMaxRowsAhead, bool bAllowGraded, bool bForward ) const; 00071 int GetClosestNote( int col, int iNoteRow, int iMaxRowsAhead, int iMaxRowsBehind, bool bAllowGraded ) const; 00072 00073 PlayerState* m_pPlayerState; 00074 PlayerStageStats* m_pPlayerStageStats; 00075 float m_fNoteFieldHeight; 00076 00077 float m_fOffset[SAMPLE_COUNT]; // for AutoSync 00078 int m_iOffsetSample; 00079 00080 NoteField* m_pNoteField; 00081 00082 HoldJudgment m_HoldJudgment[MAX_NOTE_TRACKS]; 00083 00084 Judgment m_Judgment; 00085 00086 Combo m_Combo; 00087 00088 AttackDisplay m_AttackDisplay; 00089 00090 int m_iDCState; 00091 LifeMeter* m_pLifeMeter; 00092 CombinedLifeMeter* m_pCombinedLifeMeter; 00093 ScoreDisplay* m_pScoreDisplay; 00094 ScoreDisplay* m_pSecondaryScoreDisplay; 00095 ScoreKeeper* m_pPrimaryScoreKeeper; 00096 ScoreKeeper* m_pSecondaryScoreKeeper; 00097 Inventory* m_pInventory; 00098 00099 int m_iRowLastCrossed; 00100 int m_iMineRowLastCrossed; 00101 00102 RageSound m_soundMine; 00103 RageSound m_soundAttackLaunch; 00104 RageSound m_soundAttackEnding; 00105 00106 vector<RageSound> m_vKeysounds; 00107 }; 00108 00109 #endif 00110 00111 /* 00112 * (c) 2001-2004 Chris Danford 00113 * All rights reserved. 00114 * 00115 * Permission is hereby granted, free of charge, to any person obtaining a 00116 * copy of this software and associated documentation files (the 00117 * "Software"), to deal in the Software without restriction, including 00118 * without limitation the rights to use, copy, modify, merge, publish, 00119 * distribute, and/or sell copies of the Software, and to permit persons to 00120 * whom the Software is furnished to do so, provided that the above 00121 * copyright notice(s) and this permission notice appear in all copies of 00122 * the Software and that both the above copyright notice(s) and this 00123 * permission notice appear in supporting documentation. 00124 * 00125 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 00126 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00127 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF 00128 * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS 00129 * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT 00130 * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS 00131 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 00132 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 00133 * PERFORMANCE OF THIS SOFTWARE. 00134 */

Generated on Thu Jan 27 20:57:26 2005 for StepMania by doxygen 1.3.7