public class Particle extends java.lang.Object implements BoardElement<ParticleType>
Constructor and Description |
---|
Particle(ParticleType particleType,
Direction direction)
Instantiates a new particle
|
Modifier and Type | Method and Description |
---|---|
BoardElement<ParticleType> |
copy()
Makes a copy of the board element
|
Direction |
getDirection()
Gets the direction of the element
|
ParticleType |
getType()
Gets the type of the element
|
void |
setDirection(Direction newDirection)
Changes the direction of the element
|
java.lang.String |
toString() |
public Particle(ParticleType particleType, Direction direction)
particleType
- The type of the particledirection
- The direction of the particlepublic ParticleType getType()
BoardElement
getType
in interface BoardElement<ParticleType>
public Direction getDirection()
BoardElement
getDirection
in interface BoardElement<ParticleType>
public void setDirection(Direction newDirection)
BoardElement
setDirection
in interface BoardElement<ParticleType>
newDirection
- The element's new directionpublic BoardElement<ParticleType> copy()
BoardElement
copy
in interface BoardElement<ParticleType>
public java.lang.String toString()
toString
in class java.lang.Object