Movable

interface Movable : Locatable(source)

This interface represents an object that can be moved around in a 3-dimensional space. It extends Locatable and adds a location property that can be changed. It also, at every point in time, is located at the location specified.

Since

1.0.0

See also

Types

Link copied to clipboard
interface MoveResult

Represents the result of a move operation. This interface provides a success property that indicates whether the move was successful or not. If the move was successful, success is true, otherwise it is false. The type property aims at uniquely identifying the reason why the move was not successful. The following types are available:

Properties

Link copied to clipboard
abstract override val location: Location

The location of the entity it is located at. This value is mutable and can be changed through the move method.

Functions

Link copied to clipboard
abstract suspend fun move(destination: Location): Movable.MoveResult

Tries to move the entity to the specified destination. If the entity cannot be moved to the location, the method returns a MoveResult that specifies whether the move was successful or not.