MovementActionFactory

io.github.srs.model.entity.dynamicentity.action.MovementActionFactory

Factory object for creating movement actions for dynamic entities. Provides methods to create custom movement actions with specified speeds for the left and right wheels, as well as predefined actions for moving forward, backward, turning left, turning right, and stopping.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

infix def customMove[F[_]](left: Double, right: Double): Validation[MovementAction[F]]

Creates a custom movement action with specified speeds for the left and right wheels.

Creates a custom movement action with specified speeds for the left and right wheels.

Type parameters

F

the effect type of the action.

Value parameters

left

the speed to apply to the left wheel.

right

the speed to apply to the right wheel.

Attributes

Returns

a Validation containing the MovementAction if the speeds are within the defined bounds, or an error if they are not.

infix def moveBackward[F[_]]: MovementAction[F]

Moves the robot backward by applying a negative speed to both wheels.

Moves the robot backward by applying a negative speed to both wheels.

Type parameters

F

the effect type of the action.

Attributes

Returns

the MovementAction representing the backward movement.

infix def moveForward[F[_]]: MovementAction[F]

Moves the robot forward by applying a positive speed to both wheels.

Moves the robot forward by applying a positive speed to both wheels.

Type parameters

F

the effect type of the action.

Attributes

Returns

the MovementAction representing the forward movement.

infix def stop[F[_]]: MovementAction[F]

Stops the robot by applying zero speed to both wheels.

Stops the robot by applying zero speed to both wheels.

Type parameters

F

the effect type of the action.

Attributes

Returns

the MovementAction representing the stop action.

infix def turnLeft[F[_]]: MovementAction[F]

Turns the robot left by applying a positive speed to the left wheel and a negative speed to the right wheel.

Turns the robot left by applying a positive speed to the left wheel and a negative speed to the right wheel.

Type parameters

F

the effect type of the action.

Attributes

Returns

the MovementAction representing the left turn.

infix def turnRight[F[_]]: MovementAction[F]

Turns the robot right by applying a negative speed to the left wheel and a positive speed to the right wheel.

Turns the robot right by applying a negative speed to the left wheel and a positive speed to the right wheel.

Type parameters

F

the effect type of the action.

Attributes

Returns

the MovementAction representing the right turn.