[][src]Module tokyo::behavior

Structs

Chase

A Behavior to keep moving towards the specified target until it reaches within the distance.

Dodge

A Behavior to keep dodging nearby bullets as much as possible at the maximum throttle.

Fire

A Behavior to fire the specified number of times.j

FireAt

A Behavior to rotate to the target and fire the specified number of times.

MoveTo

A Behavior to move to the destination.

Noop

A Behavior that have no effect but still consumes an action.

Rotate

A Behavior to rotate to the specified angle. It yield None if the current angle is within the error margin.

Sequence

Sequence represents a series of Behaviors. The first Behavior::next_command() is repeatedly called until it yields None, and then it moves to the second Behavior, and so forth.

Skip

A Behavior that always evaluates to None.

Throttle

A Behavior to set the current throttle value, unless it's within an error margin (hard-coded as 0.05 now).

Enums

Target

Target enum is used to specify a Player based on some predefined conditions. Some Behaviors like FireAt works with Target to dynamically compute the target Player.

Traits

Behavior

Behavior trait abstracts an action or a series of actions that a Player can take. It may be useful if you want to model a complex behavior, that spans multiple ticks, or whose interpretation changes dynamically. You can use Sequence::with_slice() to combine multiple behaviors.