C# Класс UMD.HCIL.Piccolo.Activities.PActivityScheduler

PActivityScheduler is responsible for managing a list of activities to be processed.
PActivityScheduler is given a chance to process these activities from the PRoot's ProcessInputs() method. Most users will not need to use the PActivityScheduler directly, instead you should look at:
  • PNode.AddActivity - to schedule a new activity
  • PActivity.Terminate - to terminate a running activity
  • PRoot.ProcessInputs - already calls processActivities for you.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
AddActivity ( UMD.HCIL.Piccolo.Activities.PActivity activity ) : void

Add this activity to the scheduler.

Adding an activity schedules that activity to run at some point in the future.

AddActivity ( UMD.HCIL.Piccolo.Activities.PActivity activity, bool processLast ) : void

Add this activity to the scheduler.

Adding an activity schedules that activity to run at some point in the future.

Sometimes it's useful to make sure that an activity is run after all other activities have been run. To do this set processLast to true when adding the activity.

PActivityScheduler ( UMD.HCIL.Piccolo.PRoot rootNode ) : System

Constructs a new PActivityScheduler.

ProcessActivities ( long currentTime ) : void

Process all scheduled activities for the given time. Each activity is given one "step", equivalent to one frame of animation.

RemoveActivity ( UMD.HCIL.Piccolo.Activities.PActivity activity ) : void

Remove this activity from the scheduler.

Once an activity has been removed from the scheduler, it will no longer be run.

RemoveAllActivities ( ) : void

Removes all activities currently scheduled to run.

This method clears the scheduler.

Защищенные методы

Метод Описание
StartActivityTimer ( ) : void

Starts the timer that controls the stepping of activities.

StepActivities ( object sender, EventArgs eArgs ) : void

Steps all running activities by calling the root's ProcessInputs, which in turn will call ProcessActivities.

StopActivityTimer ( ) : void

Stops the timer that controls the stepping of activities.

Описание методов

AddActivity() публичный Метод

Add this activity to the scheduler.
Adding an activity schedules that activity to run at some point in the future.
public AddActivity ( UMD.HCIL.Piccolo.Activities.PActivity activity ) : void
activity UMD.HCIL.Piccolo.Activities.PActivity The activity to be added.
Результат void

AddActivity() публичный Метод

Add this activity to the scheduler.
Adding an activity schedules that activity to run at some point in the future.

Sometimes it's useful to make sure that an activity is run after all other activities have been run. To do this set processLast to true when adding the activity.

public AddActivity ( UMD.HCIL.Piccolo.Activities.PActivity activity, bool processLast ) : void
activity UMD.HCIL.Piccolo.Activities.PActivity The activity to be added.
processLast bool /// Specifies whether the activity should be run last. ///
Результат void

PActivityScheduler() публичный Метод

Constructs a new PActivityScheduler.
public PActivityScheduler ( UMD.HCIL.Piccolo.PRoot rootNode ) : System
rootNode UMD.HCIL.Piccolo.PRoot The root node to associate with this activity scheduler.
Результат System

ProcessActivities() публичный Метод

Process all scheduled activities for the given time. Each activity is given one "step", equivalent to one frame of animation.
public ProcessActivities ( long currentTime ) : void
currentTime long The time for which to process each activity.
Результат void

RemoveActivity() публичный Метод

Remove this activity from the scheduler.
Once an activity has been removed from the scheduler, it will no longer be run.
public RemoveActivity ( UMD.HCIL.Piccolo.Activities.PActivity activity ) : void
activity UMD.HCIL.Piccolo.Activities.PActivity The activity to be removed.
Результат void

RemoveAllActivities() публичный Метод

Removes all activities currently scheduled to run.
This method clears the scheduler.
public RemoveAllActivities ( ) : void
Результат void

StartActivityTimer() защищенный Метод

Starts the timer that controls the stepping of activities.
protected StartActivityTimer ( ) : void
Результат void

StepActivities() защищенный Метод

Steps all running activities by calling the root's ProcessInputs, which in turn will call ProcessActivities.
protected StepActivities ( object sender, EventArgs eArgs ) : void
sender object The source of this Tick Event.
eArgs System.EventArgs The arguments for this Tick Event.
Результат void

StopActivityTimer() защищенный Метод

Stops the timer that controls the stepping of activities.
protected StopActivityTimer ( ) : void
Результат void