public interface ActivityType
An ActivityType is the central extension point in EngineBlock for new activity types drivers. It is responsible for naming the activity type, as well as providing the input, activity, and motor instances that will be assembled into an activity.
At the very minimum, a useful implementation of an activity type should provide an action dispenser. Default implementations of input and motor dispensers are provided, and by extension, default inputs and motors.
| Modifier and Type | Method and Description |
|---|---|
default ActionDispenser |
getActionDispenser(Activity activity)
This method will be called once per action instance.
|
default Activity |
getActivity(ActivityDef activityDef)
Create an instance of an activity from the activity type.
|
default Activity |
getAssembledActivity(ActivityDef activityDef,
Map<String,Activity> activities)
Create an instance of an activity that ties together all the components into a usable
activity instance.
|
default InputDispenser |
getInputDispenser(Activity activity)
Return the InputDispenser instance that will be used by the associated activity to create Input factories
for each thread slot.
|
default MotorDispenser |
getMotorDispenser(Activity activity,
InputDispenser inputDispenser,
ActionDispenser actionDispenser) |
String |
getName()
Return the short name of this activity type.
|
String getName()
default Activity getActivity(ActivityDef activityDef)
activityDef - the definition that initializes and controls the activity.default Activity getAssembledActivity(ActivityDef activityDef, Map<String,Activity> activities)
activityDef - the definition that initializez and controlls the activity.activities - a map of existing activitiesdefault ActionDispenser getActionDispenser(Activity activity)
activity - The activity instance that will parameterize the returned ActionDispenser instance.default InputDispenser getInputDispenser(Activity activity)
activity - the Activity instance which will parameterize this InputDispenserdefault MotorDispenser getMotorDispenser(Activity activity, InputDispenser inputDispenser, ActionDispenser actionDispenser)
Copyright © 2016. All rights reserved.