00001 /* ScoreKeeper - Abstract class to handle scorekeeping, stat-taking, etc. */ 00002 00003 #ifndef SCOREKEEPER_H 00004 #define SCOREKEEPER_H 00005 00006 /* 00007 * Stat handling is in here because that can differ between games, too; for 00008 * example, some games count double taps as a single note in scoring and 00009 * some count per-tap. 00010 * 00011 * Results are injected directly into GameState. 00012 */ 00013 00014 #include "Actor.h" 00015 #include "GameConstantsAndTypes.h" // for TapNoteScore and HoldNoteScore 00016 class NoteData; 00017 class Inventory; 00018 class Steps; 00019 struct PlayerState; 00020 struct PlayerStageStats; 00021 00022 00023 class ScoreKeeper: public Actor 00024 { 00025 protected: 00026 PlayerState* m_pPlayerState; 00027 PlayerStageStats* m_pPlayerStageStats; 00028 00029 /* Common toggles that this class handles directly: */ 00030 00031 /* If true, doubles count as 2+ in stat counts; if false, doubles count as 00032 * only one. */ /* (not yet) */ 00033 // bool Stats_DoublesCount; 00034 00035 public: 00036 ScoreKeeper(PlayerState* pPlayerState,PlayerStageStats* pPlayerStageStats) { m_pPlayerState=pPlayerState; m_pPlayerStageStats=pPlayerStageStats; } 00037 virtual void DrawPrimitives() { } 00038 virtual void Update( float fDelta ) { } 00039 00040 /* Note that pNoteData will include any transformations due to modifiers. */ 00041 virtual void OnNextSong( int iSongInCourseIndex, const Steps* pSteps, const NoteData* pNoteData ) = 0; // before a song plays (called multiple times if course) 00042 00043 virtual void HandleTapScore( TapNoteScore score ) = 0; 00044 virtual void HandleTapRowScore( TapNoteScore scoreOfLastTap, int iNumTapsInRow ) = 0; 00045 virtual void HandleHoldScore( HoldNoteScore holdScore, TapNoteScore tapScore ) = 0; 00046 }; 00047 00048 #endif 00049 00050 /* 00051 * (c) 2001-2004 Chris Danford, Glenn Maynard 00052 * All rights reserved. 00053 * 00054 * Permission is hereby granted, free of charge, to any person obtaining a 00055 * copy of this software and associated documentation files (the 00056 * "Software"), to deal in the Software without restriction, including 00057 * without limitation the rights to use, copy, modify, merge, publish, 00058 * distribute, and/or sell copies of the Software, and to permit persons to 00059 * whom the Software is furnished to do so, provided that the above 00060 * copyright notice(s) and this permission notice appear in all copies of 00061 * the Software and that both the above copyright notice(s) and this 00062 * permission notice appear in supporting documentation. 00063 * 00064 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 00065 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00066 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF 00067 * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS 00068 * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT 00069 * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS 00070 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 00071 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 00072 * PERFORMANCE OF THIS SOFTWARE. 00073 */