[TimingData] Add HasDelays() Lua binding; HasStops() now only checks stops.

This commit is contained in:
AJ Kelly
2011-08-07 13:48:42 -05:00
parent c2ec5614fa
commit ad9cec03aa
3 changed files with 14 additions and 6 deletions
+1
View File
@@ -12,6 +12,7 @@ StepMania 5.0 Preview 3 | 20110???
----------
* [LifeMeterBattery] Added LostLife param to LifeChanged message. [AJ]
* [LifeMeterBattery] Converted LifeMeterBattery lives to an AutoActor. [AJ]
* [TimingData] Add HasDelays() Lua binding; HasStops() now only checks stops. [AJ]
2011/08/06
----------
+8 -4
View File
@@ -1367,12 +1367,14 @@ bool TimingData::HasBpmChanges() const
return this->allTimingSegments[SEGMENT_BPM].size()>1;
}
// TODO: Think about splitting this up into HasStops and HasDelays.
bool TimingData::HasStops() const
{
return
this->allTimingSegments[SEGMENT_STOP].size()>0 ||
this->allTimingSegments[SEGMENT_DELAY].size()>0;
return this->allTimingSegments[SEGMENT_STOP].size()>0;
}
bool TimingData::HasDelays() const
{
return this->allTimingSegments[SEGMENT_DELAY].size()>0;
}
bool TimingData::HasWarps() const
@@ -1454,6 +1456,7 @@ class LunaTimingData: public Luna<TimingData>
{
public:
static int HasStops( T* p, lua_State *L ) { lua_pushboolean(L, p->HasStops()); return 1; }
static int HasDelays( T* p, lua_State *L ) { lua_pushboolean(L, p->HasDelays()); return 1; }
static int HasBPMChanges( T* p, lua_State *L ) { lua_pushboolean(L, p->HasBpmChanges()); return 1; }
static int HasWarps( T* p, lua_State *L ) { lua_pushboolean(L, p->HasWarps()); return 1; }
static int HasFakes( T* p, lua_State *L ) { lua_pushboolean(L, p->HasFakes()); return 1; }
@@ -1548,6 +1551,7 @@ public:
LunaTimingData()
{
ADD_METHOD( HasStops );
ADD_METHOD( HasDelays );
ADD_METHOD( HasBPMChanges );
ADD_METHOD( HasWarps );
ADD_METHOD( HasFakes );
+5 -2
View File
@@ -714,11 +714,14 @@ public:
bool HasBpmChanges() const;
/**
* @brief View the TimingData to see if there is at least one stop at any point.
*
* For the purposes of this function, Stops and Delays are considered the same.
* @return true if there is at least one stop, false otherwise.
*/
bool HasStops() const;
/**
* @brief View the TimingData to see if there is at least one delay at any point.
* @return true if there is at least one delay, false otherwise.
*/
bool HasDelays() const;
/**
* @brief View the TimingData to see if there is at least one warp at any point.
* @return true if there is at least one warp, false otherwise.