class StateMachine_State in State Machine 7
Same name and namespace in other branches
- 6 inc/base.inc \StateMachine_State
- 7.3 inc/base.inc \StateMachine_State
- 7.2 inc/base.inc \StateMachine_State
Hierarchy
- class \StateMachine_State
Expanded class hierarchy of StateMachine_State
File
View source
class StateMachine_State {
protected $machine;
protected $options;
public function __construct($machine, $options = array()) {
$this->machine = $machine;
$this->options = $options;
}
/**
* Called when entering into this state.
*/
public function on_enter() {
$args = func_get_args();
if (!empty($this->options['on_enter'])) {
call_user_func_array($this->options['on_enter'], $args);
}
}
/**
* Called when exiting out of this state.
*/
public function on_exit() {
$args = func_get_args();
if (!empty($this->options['on_exit'])) {
call_user_func_array($this->options['on_exit'], $args);
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
StateMachine_State:: |
protected | property | ||
StateMachine_State:: |
protected | property | ||
StateMachine_State:: |
public | function | Called when entering into this state. | |
StateMachine_State:: |
public | function | Called when exiting out of this state. | |
StateMachine_State:: |
public | function |