SizeChangingEntity

model.entities.SizeChangingEntity
trait SizeChangingEntity extends Sized

Trait for entities whose dimensions can be modified at runtime.

Provides methods to dynamically change an entity's width and height, useful for entities that need to resize during simulation or for configuration purposes.

Attributes

Graph
Supertypes
trait Sized
class Object
trait Matchable
class Any
Known subtypes
class Wall

Members list

Value members

Abstract methods

def withHeight(newHeight: Double): this.type

Creates a copy of this entity with a new height.

Creates a copy of this entity with a new height.

Value parameters

newHeight

the new height value

Attributes

Returns

a new instance with the updated height

def withSize(newWidth: Double, newHeight: Double): this.type

Creates a copy of this entity with new dimensions.

Creates a copy of this entity with new dimensions.

Value parameters

newHeight

the new height value

newWidth

the new width value

Attributes

Returns

a new instance with the updated dimensions

def withWidth(newWidth: Double): this.type

Creates a copy of this entity with a new width.

Creates a copy of this entity with a new width.

Value parameters

newWidth

the new width value

Attributes

Returns

a new instance with the updated width

Inherited and Abstract fields

val height: Double

Attributes

Inherited from:
Sized
val width: Double

Attributes

Inherited from:
Sized