Last change
on this file since 3d64884 was 8edd04e, checked in by Dmitry Portnoy <dmitry.portnoy@…>, 5 years ago |
Make the decompiled game code compile successfully
|
-
Property mode
set to
100644
|
File size:
1016 bytes
|
Line | |
---|
1 | package main;
|
---|
2 |
|
---|
3 | import java.util.PriorityQueue;
|
---|
4 |
|
---|
5 | public class Location {
|
---|
6 |
|
---|
7 | private Land land;
|
---|
8 | private Structure structure;
|
---|
9 | private PriorityQueue<Creature> creatures;
|
---|
10 |
|
---|
11 | public Location(Land land, Structure structure) {
|
---|
12 | this.land = land;
|
---|
13 | this.structure = structure;
|
---|
14 | this.creatures = new PriorityQueue<Creature>();
|
---|
15 | }
|
---|
16 |
|
---|
17 | public void addCreature(Creature creature) {
|
---|
18 | this.creatures.add(creature);
|
---|
19 | }
|
---|
20 |
|
---|
21 | public void spawnCreature(Creature creature, Point loc) {
|
---|
22 | Creature newC = creature.copy();
|
---|
23 | newC.setLoc(loc);
|
---|
24 | this.creatures.add(newC);
|
---|
25 | }
|
---|
26 |
|
---|
27 | public Land getLand() {
|
---|
28 | return this.land;
|
---|
29 | }
|
---|
30 |
|
---|
31 | public Structure getStruct() {
|
---|
32 | return this.structure;
|
---|
33 | }
|
---|
34 |
|
---|
35 | public PriorityQueue<Creature> getCreatures() {
|
---|
36 | return this.creatures;
|
---|
37 | }
|
---|
38 |
|
---|
39 | public void setLand(Land type) {
|
---|
40 | this.land = type;
|
---|
41 | }
|
---|
42 |
|
---|
43 | public void setStruct(Structure type) {
|
---|
44 | this.structure = type;
|
---|
45 | }
|
---|
46 |
|
---|
47 | public boolean isPassable() {
|
---|
48 | return (this.land.isPassable() && this.structure.isPassable());
|
---|
49 | }
|
---|
50 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.