Constructor and Description |
---|
ActorWorld()
Constructs an actor world with a default grid.
|
ActorWorld(Grid<Actor> grid)
Constructs an actor world with a given grid.
|
Modifier and Type | Method and Description |
---|---|
void |
add(Actor occupant)
Adds an occupant at a random empty location.
|
void |
add(Location loc,
Actor occupant)
Adds an actor to this world at a given location.
|
Actor |
remove(Location loc)
Removes an actor from this world.
|
void |
show()
Constructs and shows a frame for this world.
|
void |
step()
This method is called when the user clicks on the step button, or when
run mode has been activated by clicking the run button.
|
addGridClass, addOccupantClass, getGrid, getGridClasses, getMessage, getOccupantClasses, getRandomEmptyLocation, keyPressed, locationClicked, setGrid, setMessage, toString
public void show()
World
public void step()
World
public void add(Actor occupant)
occupant
- the occupant to add