public class PActivityScheduler extends Object implements Serializable
Constructor and Description |
---|
PActivityScheduler(PRoot rootNode)
Constructs an instance of PActivityScheduler.
|
Modifier and Type | Method and Description |
---|---|
void |
addActivity(PActivity activity)
Adds the given activity to the scheduler if not already found.
|
void |
addActivity(PActivity activity,
boolean processLast)
Add this activity to the scheduler.
|
List |
getActivitiesReference()
Returns a reference to the current activities list.
|
protected Timer |
getActivityTimer()
Returns the activity timer.
|
boolean |
getAnimating()
Return true if any of the scheduled activities are animations.
|
PRoot |
getRoot()
Returns the node from which all activities will be attached.
|
void |
processActivities(long currentTime)
Process all scheduled activities for the given time.
|
void |
removeActivity(PActivity activity)
Removes the given activity from the scheduled activities.
|
void |
removeAllActivities()
Removes all activities from the list of scheduled activities.
|
protected void |
startActivityTimer()
Starts the current activity timer.
|
protected void |
stopActivityTimer()
Stops the current activity timer.
|
public PActivityScheduler(PRoot rootNode)
rootNode
- root node of all activities to be performed. All nodes
being animated should have this node as an ancestor.public PRoot getRoot()
public void addActivity(PActivity activity)
activity
- activity to be scheduledpublic void addActivity(PActivity activity, boolean processLast)
activity
- activity to be scheduledprocessLast
- whether or not this activity should be performed after
all other scheduled activitiespublic void removeActivity(PActivity activity)
activity
- the activity to be removedpublic void removeAllActivities()
public List getActivitiesReference()
public void processActivities(long currentTime)
currentTime
- the current unix time in milliseconds.public boolean getAnimating()
protected void startActivityTimer()
protected void stopActivityTimer()
protected Timer getActivityTimer()
Copyright © 1995-2013 Piccolo2D. All Rights Reserved.