Context

model.managers.movements.Boids.Context
case class Context[M <: Movable[M]](boid: M, others: Seq[M]) extends Movable[Context[M]]

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Movable[Context[M]]
trait Positioned
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def directionAdded(addingDirection: Vector2D): Context[M]
override def withDirection(newDirection: Vector2D): Context[M]

Returns a new instance of the entity with an updated direction. This method ensures immutability.

Returns a new instance of the entity with an updated direction. This method ensures immutability.

Value parameters

newDirection

The new direction vector for the entity.

Attributes

Returns

A new instance of the entity with the updated direction.

Definition Classes
override def withPosition(newPosition: Vector2D): Context[M]

Returns a new instance of the entity with an updated position. This method ensures immutability.

Returns a new instance of the entity with an updated position. This method ensures immutability.

Value parameters

newPosition

The new position for the entity.

Attributes

Returns

A new instance of the entity with the updated position.

Definition Classes

Inherited methods

def addedDirection(addingDirection: Vector2D): Context[M]

Returns a new instance of the entity with its direction updated by adding a given vector to the current direction.

Returns a new instance of the entity with its direction updated by adding a given vector to the current direction.

Value parameters

addingDirection

The vector to add to the current direction.

Attributes

Returns

A new instance of the entity with the added direction.

Inherited from:
Movable
def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product

Exports

Defined exports

Exported from Movable

The current direction vector of the entity.

The current direction vector of the entity.

Attributes

Exported from Positioned