2002-11-16 08:07:38 +00:00
|
|
|
#ifndef PLAYER_H
|
|
|
|
|
#define PLAYER_H
|
2001-11-04 19:34:28 +00:00
|
|
|
/*
|
|
|
|
|
-----------------------------------------------------------------------------
|
2002-07-23 01:41:40 +00:00
|
|
|
Class: Player
|
2001-11-04 19:34:28 +00:00
|
|
|
|
2002-04-28 20:42:32 +00:00
|
|
|
Desc: Object that accepts pad input, knocks down ColorNotes that were stepped on,
|
2001-11-04 19:34:28 +00:00
|
|
|
and keeps score for the player.
|
|
|
|
|
|
2002-05-19 01:59:48 +00:00
|
|
|
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
2002-04-28 20:42:32 +00:00
|
|
|
Chris Danford
|
2001-11-04 19:34:28 +00:00
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
*/
|
2001-11-03 10:52:42 +00:00
|
|
|
|
2002-06-14 22:25:22 +00:00
|
|
|
#include "PrefsManager.h" // for GameplayStatistics
|
2001-11-04 19:34:28 +00:00
|
|
|
#include "Sprite.h"
|
2002-01-16 10:01:32 +00:00
|
|
|
#include "BitmapText.h"
|
2001-11-03 10:52:42 +00:00
|
|
|
|
2001-11-29 11:05:04 +00:00
|
|
|
#include "GrayArrow.h"
|
|
|
|
|
#include "GhostArrow.h"
|
2001-12-28 10:15:59 +00:00
|
|
|
#include "GhostArrowBright.h"
|
2001-12-19 01:50:57 +00:00
|
|
|
#include "HoldGhostArrow.h"
|
2001-12-20 12:37:38 +00:00
|
|
|
#include "ActorFrame.h"
|
2002-03-10 10:30:45 +00:00
|
|
|
#include "RandomSample.h"
|
2003-02-17 12:19:42 +00:00
|
|
|
#include "Judgment.h"
|
|
|
|
|
#include "HoldJudgment.h"
|
2002-02-24 01:43:11 +00:00
|
|
|
#include "Combo.h"
|
2002-04-16 17:31:00 +00:00
|
|
|
#include "NoteField.h"
|
|
|
|
|
#include "GrayArrowRow.h"
|
|
|
|
|
#include "GhostArrowRow.h"
|
2002-06-24 22:04:31 +00:00
|
|
|
#include "NoteDataWithScoring.h"
|
2003-02-25 02:51:04 +00:00
|
|
|
class ScoreDisplay;
|
|
|
|
|
class LifeMeter;
|
|
|
|
|
class ScoreKeeper;
|
|
|
|
|
class Inventory;
|
2001-11-29 11:05:04 +00:00
|
|
|
|
2002-10-01 01:53:56 +00:00
|
|
|
#define SAMPLE_COUNT 16
|
2001-11-29 11:05:04 +00:00
|
|
|
|
2002-06-24 22:04:31 +00:00
|
|
|
class Player : public NoteDataWithScoring, public ActorFrame
|
2001-11-03 10:52:42 +00:00
|
|
|
{
|
|
|
|
|
public:
|
2002-02-02 05:11:12 +00:00
|
|
|
Player();
|
2001-11-03 10:52:42 +00:00
|
|
|
|
2002-07-28 20:28:37 +00:00
|
|
|
virtual void Update( float fDeltaTime );
|
|
|
|
|
virtual void DrawPrimitives();
|
2002-11-03 07:17:03 +00:00
|
|
|
~Player();
|
2002-01-16 10:01:32 +00:00
|
|
|
|
2003-03-16 18:57:34 +00:00
|
|
|
void Load( PlayerNumber player_no, NoteData* pNoteData, LifeMeter* pLM, ScoreDisplay* pScore, Inventory* pInventory, ScoreKeeper* pScoreKeeper );
|
2002-07-28 20:28:37 +00:00
|
|
|
void CrossedRow( int iNoteRow );
|
|
|
|
|
void Step( int col );
|
2002-02-24 01:43:11 +00:00
|
|
|
|
2002-09-05 03:45:07 +00:00
|
|
|
void FadeToFail();
|
2002-08-01 21:55:40 +00:00
|
|
|
|
2001-11-04 19:34:28 +00:00
|
|
|
protected:
|
2003-03-26 21:35:15 +00:00
|
|
|
void UpdateTapNotesMissedOlderThan( float fMissIfOlderThanThisBeat );
|
2003-03-26 19:34:59 +00:00
|
|
|
void OnRowDestroyed( int iStepIndex );
|
2003-03-26 21:35:15 +00:00
|
|
|
void HandleTapRowScore( unsigned row );
|
2003-03-16 17:45:32 +00:00
|
|
|
void HandleHoldScore( HoldNoteScore holdScore, TapNoteScore tapScore );
|
2003-03-26 18:48:19 +00:00
|
|
|
void HandleAutosync(float fNoteOffset);
|
2002-07-28 20:28:37 +00:00
|
|
|
|
2003-02-17 05:25:20 +00:00
|
|
|
int GetClosestNoteDirectional( int col, float fBeat, float fMaxBeatsAhead, int iDirection );
|
|
|
|
|
int GetClosestNote( int col, float fBeat, float fMaxBeatsAhead, float fMaxBeatsBehind );
|
2003-02-09 02:07:30 +00:00
|
|
|
|
2003-02-09 04:05:31 +00:00
|
|
|
static float GetMaxStepDistanceSeconds();
|
2001-11-04 19:34:28 +00:00
|
|
|
|
2001-12-20 12:37:38 +00:00
|
|
|
PlayerNumber m_PlayerNumber;
|
2001-12-19 01:50:57 +00:00
|
|
|
|
2002-10-01 01:53:56 +00:00
|
|
|
float m_fOffset[SAMPLE_COUNT];//for AutoAdjust
|
|
|
|
|
int m_iOffsetSample; //
|
2001-11-04 19:34:28 +00:00
|
|
|
|
2002-10-01 01:53:56 +00:00
|
|
|
GrayArrowRow m_GrayArrowRow;
|
|
|
|
|
NoteField m_NoteField;
|
|
|
|
|
GhostArrowRow m_GhostArrowRow;
|
2002-07-23 01:41:40 +00:00
|
|
|
|
2003-02-17 12:19:42 +00:00
|
|
|
HoldJudgment m_HoldJudgment[MAX_NOTE_TRACKS];
|
2002-10-01 01:53:56 +00:00
|
|
|
|
2003-02-17 12:19:42 +00:00
|
|
|
Judgment m_Judgment;
|
2002-07-23 01:41:40 +00:00
|
|
|
|
2002-10-01 01:53:56 +00:00
|
|
|
Combo m_Combo;
|
2002-07-23 01:41:40 +00:00
|
|
|
|
2002-10-01 01:53:56 +00:00
|
|
|
LifeMeter* m_pLifeMeter;
|
|
|
|
|
ScoreDisplay* m_pScore;
|
2003-02-25 02:51:04 +00:00
|
|
|
ScoreKeeper* m_pScoreKeeper;
|
|
|
|
|
Inventory* m_pInventory;
|
2001-11-03 10:52:42 +00:00
|
|
|
};
|
2002-11-16 08:07:38 +00:00
|
|
|
|
|
|
|
|
#endif
|