Last change
on this file since a5b4186 was a5b4186, checked in by dportnoy <dmp1488@…>, 18 years ago |
[svn r36] Renamed remotely
|
-
Property mode
set to
100644
|
File size:
722 bytes
|
Rev | Line | |
---|
[a5b4186] | 1 | import java.util.*;
|
---|
| 2 |
|
---|
| 3 | public class Location {
|
---|
| 4 | private Land land;
|
---|
| 5 | private Structure structure;
|
---|
| 6 | private PriorityQueue<Creature> creatures;
|
---|
| 7 |
|
---|
| 8 | public Location(Land land, Structure structure) {
|
---|
| 9 | this.land = land;
|
---|
| 10 | this.structure = structure;
|
---|
| 11 | this.creatures = new PriorityQueue<Creature>();
|
---|
| 12 | }
|
---|
| 13 |
|
---|
| 14 | public void addCreature(Creature creature) {
|
---|
| 15 | creatures.add(creature);
|
---|
| 16 | }
|
---|
| 17 |
|
---|
| 18 | public Land getLand() {
|
---|
| 19 | return land;
|
---|
| 20 | }
|
---|
| 21 |
|
---|
| 22 | public Structure getStruct() {
|
---|
| 23 | return structure;
|
---|
| 24 | }
|
---|
| 25 |
|
---|
| 26 | public void setLand(Land type) {
|
---|
| 27 | land = type;
|
---|
| 28 | }
|
---|
| 29 |
|
---|
| 30 | public void setStruct(Structure type) {
|
---|
| 31 | structure = type;
|
---|
| 32 | }
|
---|
| 33 |
|
---|
| 34 | public boolean isPassable() {
|
---|
| 35 | return land.isPassable() && structure.isPassable();
|
---|
| 36 | }
|
---|
| 37 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.