#include <Method.h>
Public Member Functions | |
Method (ptr< TaskFactory > body) | |
Creates a new Method using the given basic or compound task. | |
virtual | ~Method () |
Deletes this method. | |
ptr< SceneNode > | getOwner () |
Returns the SceneNode to which this Method belongs. | |
bool | isEnabled () |
Returns true if this method is enabled. | |
void | setIsEnabled (bool enabled) |
Enables or disables this method. | |
ptr< TaskFactory > | getTaskFactory () |
Returns the body of this method. | |
void | setTaskFactory (ptr< TaskFactory > taskFactory) |
Sets the body of this method. | |
ptr< Task > | getTask () |
Returns the Task to be run to execute this method. |
A SceneNode method.
A Method defines a behavior of a scene node. It can be a basic task or a combination of basic tasks using sequences, loops or method calls. The body of a method is TaskFactory that can be shared between several methods. This TaskFactory is used to get the tasks to be run to execute the method, depending on the context (the context passed to TaskFactory::getTask being the Method itself, from which the owner SceneNode can be found, and then then owner SceneManager).
ork::Method::Method | ( | ptr< TaskFactory > | body | ) |
Creates a new Method using the given basic or compound task.
body | the method definition. |
virtual ork::Method::~Method | ( | ) | [virtual] |
Deletes this method.
Returns the SceneNode to which this Method belongs.
See SceneNode::getMethod.
ptr<TaskFactory> ork::Method::getTaskFactory | ( | ) |
Returns the body of this method.
bool ork::Method::isEnabled | ( | ) |
Returns true if this method is enabled.
A call to disabled method is skipped. A method is enabled by default.
void ork::Method::setIsEnabled | ( | bool | enabled | ) |
Enables or disables this method.
A call to disabled method is skipped.
enabled | true to enable this method, false to disable it. |
void ork::Method::setTaskFactory | ( | ptr< TaskFactory > | taskFactory | ) |
Sets the body of this method.
taskFactory | the new method body. |