Class Obstacle
java.lang.Object
za.co.wethinkcode.robots.server.world.Obstacle
- All Implemented Interfaces:
Iterable<Position>,WorldObject
- Direct Known Subclasses:
MineObstacle,PitObstacle
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordRecord class of a single brick of an Obstacle -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddObstacle(Position pos) booleanThis check returns if the WorldObject in question blocks the sightlinevoidclear()getAll()booleanhasObstacle(Position pos) booleanisEmpty()iterator()voidloadObstaclesFromPattern(int type) intsize()toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
Obstacle
-
-
Method Details
-
addObstacle
-
hasObstacle
-
getAll
-
clear
public void clear() -
size
public int size() -
isEmpty
public boolean isEmpty() -
iterator
-
loadObstaclesFromPattern
public void loadObstaclesFromPattern(int type) -
getTopLeft
-
getBottomRight
-
blocksSightline
public boolean blocksSightline()This check returns if the WorldObject in question blocks the sightlineUseful for the
LookCommand- Specified by:
blocksSightlinein interfaceWorldObject- Returns:
- if a world object blocks the sightline, and prevents other objects from being seen beyond it
-
toString
-
getSymbol
- Specified by:
getSymbolin interfaceWorldObject
-