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