|
sdr 0.7 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.cscott.sdr.calls.DanceState
public class DanceState
DanceState captures all the dynamic information about a
dance: the current formation and the queues of dancer actions and calls. It
includes a link to a DanceProgram which is the static information
about the dance.
| Field Summary | |
|---|---|
DanceProgram |
dance
|
| Constructor Summary | |
|---|---|
DanceState(DanceProgram dance,
Formation f)
|
|
DanceState(DanceProgram dance,
Formation f,
Map<String,String> properties)
|
|
| Method Summary | |
|---|---|
void |
add(Dancer d,
DancerPath dp)
Move the given dancer along the specified dancer path. |
DanceState |
cloneAndClear()
Return a new independent dance state with the same static state and current formation, but empty movements and actions. |
DanceState |
cloneAndClear(Formation formation)
Similar to cloneAndClear(), but allows you to specify the new
'current formation' of the result. |
Formation |
currentFormation()
Return the last in the list of timed formations. |
Fraction |
currentTime()
Return the time of the last formation. |
Set<Dancer> |
dancers()
Return all the Dancers in this DanceState. |
Set<Dancer> |
designated()
Look at the top of the designated dancer stack. |
Formation |
formationAt(Fraction time)
Return the latest formation at or preceding the given time. |
List<TimedFormation> |
formations()
Return a sorted list of TimedFormations describing the net
effect of the DancerPaths in this DanceState. |
List<DancerPath> |
movements(Dancer d)
Return all the DancerPaths, in order, performed by the given
Dancer. |
void |
popDesignated()
Pop the top off the designated dancer stack. |
String |
property(String name,
String defaultValue)
Access the environment's property map. |
void |
pushDesignated(Set<Dancer> designated)
Add the set of designated dancers to the stack stored in the DanceState. |
void |
syncDancers()
Add "do nothing" actions as necessary so that every dancer's next action will occur at the same time. |
void |
syncDancers(Fraction time)
Add "do nothing" actions as necessary so that every dancer's next action will occur at the given time. |
TaggedFormation |
tagDesignated(Formation f)
Add the 'DESIGNATED' tag to the given Formation. |
FormationMatch |
tagDesignated(FormationMatch fm)
Add the 'DESIGNATED' tag to the given FormationMatch. |
String |
toString()
|
void |
unsyncDancers()
Remove any trailing "do nothing" actions so that the next action flows directly from the previous one. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public final DanceProgram dance
| Constructor Detail |
|---|
public DanceState(DanceProgram dance,
Formation f,
Map<String,String> properties)
public DanceState(DanceProgram dance,
Formation f)
| Method Detail |
|---|
public String toString()
toString in class Objectpublic Formation currentFormation()
public Fraction currentTime()
public DanceState cloneAndClear()
public DanceState cloneAndClear(Formation formation)
cloneAndClear(), but allows you to specify the new
'current formation' of the result. This is useful for concepts which
alter the shape of the current formation (say, creating a mirror image)
before applying the subcall.
formation - what result.currentFormation() should return.
public void pushDesignated(Set<Dancer> designated)
DanceState.
designated - public void popDesignated()
public Set<Dancer> designated()
public TaggedFormation tagDesignated(Formation f)
public FormationMatch tagDesignated(FormationMatch fm)
public String property(String name,
String defaultValue)
ExprList._PROPERTY
public void add(Dancer d,
DancerPath dp)
currentFormation(), and may create additional intermediate
formations, if the DancerPath.time falls in between existing
formations.
public void syncDancers()
public void syncDancers(Fraction time)
public void unsyncDancers()
public List<DancerPath> movements(Dancer d)
DancerPaths, in order, performed by the given
Dancer.
public Set<Dancer> dancers()
Dancers in this DanceState.
public List<TimedFormation> formations()
TimedFormations describing the net
effect of the DancerPaths in this DanceState. The first
element in the list will match the starting formation provided when this
DanceState was constructed, will have an absolute time of
Fraction.ZERO, and will have all dancers selected. The final
element in the list will represent the final state. Formations should not
be considered animation targets: not all dancers will have moved in all
formations. For example, if dancer #1 has a movement which takes 2 beats,
and dancer #2 has two movements which take 1 each, the result list will
include the starting formation, with time 0, an intermediate formation
with time 1 where dancer #1 is in their starting position and dancer #2
has taken their first movement, and a final position with time 2 where
both dancer #1 and dancer #2 have moved. Consult the list of
DancerPaths for accurate animation information.
public Formation formationAt(Fraction time)
|
sdr 0.7 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||