Files
itgmania212121/stepmania/src/Trail.h
T

105 lines
3.0 KiB
C++
Raw Normal View History

2004-05-31 21:35:31 +00:00
/* Trail - A queue of Songs and Steps that are generated from a Course. */
2004-05-23 09:17:10 +00:00
2004-05-31 21:35:31 +00:00
#ifndef TRAIL_H
#define TRAIL_H
#include "Attack.h"
#include "RadarValues.h"
2006-11-12 03:26:25 +00:00
#include "Difficulty.h"
class Song;
class Steps;
2005-05-06 11:59:09 +00:00
struct lua_State;
struct TrailEntry
{
TrailEntry():
pSong(NULL),
2006-11-12 03:26:25 +00:00
pSteps(NULL),
2005-03-10 22:54:55 +00:00
bSecret(false),
iLowMeter(-1),
iHighMeter(-1),
2006-10-07 04:39:48 +00:00
dc(Difficulty_Invalid)
{
}
2006-11-12 03:26:25 +00:00
void GetAttackArray( AttackArray &out ) const;
Song* pSong;
2006-11-12 03:26:25 +00:00
Steps* pSteps;
2006-01-22 01:00:06 +00:00
RString Modifiers;
2006-01-17 05:25:26 +00:00
AttackArray Attacks;
2005-08-01 05:10:54 +00:00
bool bSecret; // show "???"
/* These represent the meter and difficulty used by the course to pick the
* steps; if you want the real difficulty and meter, look at pSteps. */
2006-01-17 05:25:26 +00:00
int iLowMeter;
int iHighMeter;
Difficulty dc;
2004-05-31 20:04:56 +00:00
bool operator== ( const TrailEntry &rhs ) const;
bool operator!= ( const TrailEntry &rhs ) const { return !(*this==rhs); }
2006-11-12 03:26:25 +00:00
bool ContainsTransformOrTurn() const;
};
class Trail
{
public:
2006-01-17 05:25:26 +00:00
StepsType m_StepsType;
2004-05-23 09:17:10 +00:00
CourseDifficulty m_CourseDifficulty;
2006-01-17 05:25:26 +00:00
vector<TrailEntry> m_vEntries;
int m_iSpecifiedMeter; // == -1 if no meter specified
mutable bool m_bRadarValuesCached;
mutable RadarValues m_CachedRadarValues;
Trail()
2004-06-03 08:22:02 +00:00
{
Init();
}
void Init()
{
2006-09-26 20:28:46 +00:00
m_StepsType = StepsType_Invalid;
m_CourseDifficulty = Difficulty_Invalid;
2004-06-03 08:22:02 +00:00
m_iSpecifiedMeter = -1;
m_vEntries.clear();
m_bRadarValuesCached = false;
}
2006-08-16 05:11:32 +00:00
const RadarValues &GetRadarValues() const;
2005-03-07 22:30:39 +00:00
void SetRadarValues( const RadarValues &rv ); // for pre-populating cache
2004-06-03 08:22:02 +00:00
int GetMeter() const;
int GetTotalMeter() const;
float GetLengthSeconds() const;
2006-01-17 05:24:42 +00:00
void GetDisplayBpms( DisplayBpms &AddTo ) const;
2005-03-10 22:54:55 +00:00
bool IsSecret() const;
2006-11-13 18:28:29 +00:00
bool ContainsSong( const Song *pSong ) const;
2005-05-06 11:59:09 +00:00
// Lua
void PushSelf( lua_State *L );
};
#endif
2004-05-31 21:35:31 +00:00
/*
* (c) 2001-2004 Chris Danford, Glenn Maynard
* All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, and/or sell copies of the Software, and to permit persons to
* whom the Software is furnished to do so, provided that the above
* copyright notice(s) and this permission notice appear in all copies of
* the Software and that both the above copyright notice(s) and this
* permission notice appear in supporting documentation.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
* THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
* INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/