00001 /* Trail - A queue of Songs and Steps that are generated from a Course. */ 00002 00003 #ifndef TRAIL_H 00004 #define TRAIL_H 00005 00006 #include "Attack.h" 00007 #include "RadarValues.h" 00008 #include "Difficulty.h" 00009 00010 class Song; 00011 class Steps; 00012 00013 struct TrailEntry 00014 { 00015 TrailEntry(): 00016 pSong(NULL), 00017 pSteps(NULL), 00018 bMystery(false), 00019 iLowMeter(-1), 00020 iHighMeter(-1), 00021 dc(DIFFICULTY_INVALID) 00022 { 00023 } 00024 void GetAttackArray( AttackArray &out ) const; 00025 00026 Song* pSong; 00027 Steps* pSteps; 00028 CString Modifiers; 00029 AttackArray Attacks; 00030 bool bMystery; 00031 00032 /* These represent the meter and difficulty used by the course to pick the 00033 * steps; if you want the real difficulty and meter, look at pSteps. */ 00034 int iLowMeter; 00035 int iHighMeter; 00036 Difficulty dc; 00037 bool operator== ( const TrailEntry &rhs ) const; 00038 bool operator!= ( const TrailEntry &rhs ) const { return !(*this==rhs); } 00039 bool ContainsTransformOrTurn() const; 00040 }; 00041 00042 class Trail 00043 { 00044 public: 00045 StepsType m_StepsType; 00046 CourseDifficulty m_CourseDifficulty; 00047 vector<TrailEntry> m_vEntries; 00048 int m_iSpecifiedMeter; // == -1 if no meter specified 00049 mutable bool m_bRadarValuesCached; 00050 mutable RadarValues m_CachedRadarValues; 00051 00052 Trail() 00053 { 00054 Init(); 00055 } 00056 void Init() 00057 { 00058 m_StepsType = STEPS_TYPE_INVALID; 00059 m_CourseDifficulty = DIFFICULTY_INVALID; 00060 m_iSpecifiedMeter = -1; 00061 m_vEntries.clear(); 00062 m_bRadarValuesCached = false; 00063 } 00064 00065 RadarValues GetRadarValues() const; 00066 int GetMeter() const; 00067 int GetTotalMeter() const; 00068 float GetLengthSeconds() const; 00069 void GetDisplayBpms( DisplayBpms &AddTo ); 00070 bool IsMystery() const; 00071 bool ContainsSong( Song* pSong ) const; 00072 }; 00073 00074 #endif 00075 00076 /* 00077 * (c) 2001-2004 Chris Danford, Glenn Maynard 00078 * All rights reserved. 00079 * 00080 * Permission is hereby granted, free of charge, to any person obtaining a 00081 * copy of this software and associated documentation files (the 00082 * "Software"), to deal in the Software without restriction, including 00083 * without limitation the rights to use, copy, modify, merge, publish, 00084 * distribute, and/or sell copies of the Software, and to permit persons to 00085 * whom the Software is furnished to do so, provided that the above 00086 * copyright notice(s) and this permission notice appear in all copies of 00087 * the Software and that both the above copyright notice(s) and this 00088 * permission notice appear in supporting documentation. 00089 * 00090 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 00091 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00092 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF 00093 * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS 00094 * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT 00095 * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS 00096 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 00097 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 00098 * PERFORMANCE OF THIS SOFTWARE. 00099 */