public class SoundBehavior extends SimpleBehavior
shouldYield
Constructor and Description |
---|
SoundBehavior(java.lang.Runnable trigger)
constructs a Sound Behavior by passing a generic
code to be called each time a clap is detected
|
Modifier and Type | Method and Description |
---|---|
boolean |
claimsControl()
Claims control when the clap counter
is strictly positive
|
void |
gainControl()
Run the generic code when clap is detected
|
int |
getPriority()
Priority is high (2)
|
reset, yieldControl
public SoundBehavior(java.lang.Runnable trigger)
trigger
- public boolean claimsControl()
public void gainControl()
public int getPriority()