trait MovingObject extends HasVelocity with MutablePos
A supertype for objects that have a mutable position and a velocity in two-dimensional space.
- Alphabetic
- By Inheritance
- MovingObject
- MutablePos
- HasVelocity
- HasPos
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- abstract val pos: Pos
the object’s location
the object’s location
- Definition Classes
- MutablePos → HasPos
- abstract def velocity: Velocity
the object's velocity
the object's velocity
- Definition Classes
- HasVelocity
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##(): Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- def distance(another: HasPos): Double
Determines the distance (“as the crow flies”) between this object’s
pos
and that of the given object.Determines the distance (“as the crow flies”) between this object’s
pos
and that of the given object.- Definition Classes
- HasPos
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def isBoundFor(direction: Direction): Boolean
Determines whether this objectis bound for roughly the given direction, as per Direction.sharesQuadrant.
Determines whether this objectis bound for roughly the given direction, as per Direction.sharesQuadrant.
- Definition Classes
- HasVelocity
- def isDownbound: Boolean
Determines whether this objecthas a downward velocity, as per Direction.isDownward.
Determines whether this objecthas a downward velocity, as per Direction.isDownward.
- Definition Classes
- HasVelocity
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isLeftbound: Boolean
Determines whether this objecthas a leftward velocity, as per Direction.isLeftward.
Determines whether this objecthas a leftward velocity, as per Direction.isLeftward.
- Definition Classes
- HasVelocity
- def isRightbound: Boolean
Determines whether this objecthas a rightward velocity, as per Direction.isRightward.
Determines whether this objecthas a rightward velocity, as per Direction.isRightward.
- Definition Classes
- HasVelocity
- def isUpbound: Boolean
Determines whether this objecthas an upward velocity, as per Direction.isUpward.
Determines whether this objecthas an upward velocity, as per Direction.isUpward.
- Definition Classes
- HasVelocity
- def moveAlong(): Unit
Causes the object’s pos to change: the object moves from its current location at its current velocity for one unit of time.
- def moveWithin(container: HasEdges): Unit
Causes the object’s pos to change: the object moves from its current location at its current velocity for one unit of time (as per moveAlong) and is then immediately clamped to fit within the bounds of the given object (as per Pos.clamp).
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def nextPos: Pos
Returns the
Pos
that this object, moving from its current location at its current velocity, reaches in one unit of time.Returns the
Pos
that this object, moving from its current location at its current velocity, reaches in one unit of time. That is, adds thedx
anddy
components of the velocity to the currentPos
and returns the result.- Definition Classes
- HasVelocity
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString: String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated @deprecated
- Deprecated
(Since version ) see corresponding Javadoc for more information.