public class Desk extends PhysicalObject implements Openable
Modifier and Type | Field and Description |
---|---|
private HumanAgent |
agentAtDesk
The agent at the desk.
|
private boolean |
isOpen
The system is open or closed.
|
private Position |
servingPosition
The serving position.
|
shape
position
map
Constructor and Description |
---|
Desk(double[] x,
double[] y,
Position servingPosition)
Create a wall from a list of (x,y) coordinates.
|
Desk(double x0,
double x1,
double x2,
double x3,
double y0,
double y1,
double y2,
double y3,
Position servingPosition)
Creates a wall from four corner coordinates.
|
Desk(double topX,
double topY,
double width,
double height,
Position servingPosition)
Creates a rectangular wall with a specified top left corner, width and
height.
|
Desk(java.util.List<Position> corners,
Position servingPosition)
Create a wall from a list of corner
Position s. |
Modifier and Type | Method and Description |
---|---|
void |
emptyReservation()
Empties the reservation of the desk.
|
HumanAgent |
getAgentAtDesk()
Gets the agent at the desk.
|
Position |
getServingPosition()
Gets the serving position.
|
boolean |
isOccupied()
Determines if the desk is occupied.
|
boolean |
isOpen()
Is open or not.
|
void |
reserveDesk(HumanAgent agentAtDesk)
Sets the agent at the desk.
|
void |
setOpen(boolean isOpen)
Sets open.
|
java.lang.String |
toString() |
contains, contains, generatePosition, generatePosition, generatePositions, generatePositions, getCorners, getVectorToPosition, isCollision, isLineCollision
getDistance, getPosition
isDestroyed
private Position servingPosition
private HumanAgent agentAtDesk
private boolean isOpen
public Desk(double x0, double x1, double x2, double x3, double y0, double y1, double y2, double y3, Position servingPosition)
x0
- The first x coordinate.x1
- The second x coordinate.x2
- The third x coordinate.x3
- The fourth x coordinate.y0
- The first y coordinate.y1
- The second y coordinate.y2
- The third y coordinate.y3
- The fourth y coordinate.servingPosition
- The serving position.public Desk(double topX, double topY, double width, double height, Position servingPosition)
topX
- The x coordinate of the top left corner.topY
- The y coordinate of the top left corner.width
- The width of the wall.height
- The height of the wall.servingPosition
- The serving position.public Desk(double[] x, double[] y, Position servingPosition)
x
- The x coordinates.y
- The y coordinates.servingPosition
- The serving position.public HumanAgent getAgentAtDesk()
public Position getServingPosition()
public boolean isOccupied()
public boolean isOpen()
Openable
public void emptyReservation()
public void reserveDesk(HumanAgent agentAtDesk)
agentAtDesk
- The agent at the desk.public void setOpen(boolean isOpen)
Openable
public java.lang.String toString()
toString
in class PolygonMapComponent