diff --git a/bin/net/grosinger/nomads/Building$Structure.class b/bin/net/grosinger/nomads/Building$Structure.class
index 2179df0..f8e0131 100644
Binary files a/bin/net/grosinger/nomads/Building$Structure.class and b/bin/net/grosinger/nomads/Building$Structure.class differ
diff --git a/bin/net/grosinger/nomads/Building.class b/bin/net/grosinger/nomads/Building.class
index fd2ad2c..1d7da41 100644
Binary files a/bin/net/grosinger/nomads/Building.class and b/bin/net/grosinger/nomads/Building.class differ
diff --git a/bin/net/grosinger/nomads/House.class b/bin/net/grosinger/nomads/House.class
index 0c10342..521d1bd 100644
Binary files a/bin/net/grosinger/nomads/House.class and b/bin/net/grosinger/nomads/House.class differ
diff --git a/bin/net/grosinger/nomads/InitializeGame.class b/bin/net/grosinger/nomads/InitializeGame.class
index fe91f23..9f232c3 100644
Binary files a/bin/net/grosinger/nomads/InitializeGame.class and b/bin/net/grosinger/nomads/InitializeGame.class differ
diff --git a/bin/net/grosinger/nomads/NeighborBuilding.class b/bin/net/grosinger/nomads/NeighborBuilding.class
index c3c55b3..014ff27 100644
Binary files a/bin/net/grosinger/nomads/NeighborBuilding.class and b/bin/net/grosinger/nomads/NeighborBuilding.class differ
diff --git a/bin/net/grosinger/nomads/TownHall.class b/bin/net/grosinger/nomads/TownHall.class
index acd89ae..b066d56 100644
Binary files a/bin/net/grosinger/nomads/TownHall.class and b/bin/net/grosinger/nomads/TownHall.class differ
diff --git a/src/net/grosinger/nomads/Building.java b/src/net/grosinger/nomads/Building.java
index d95ef96..86c934e 100644
--- a/src/net/grosinger/nomads/Building.java
+++ b/src/net/grosinger/nomads/Building.java
@@ -16,6 +16,7 @@ package net.grosinger.nomads;
public class Building implements GameObject {
Structure structure;
String name;
+ DroneTeam team;
int x;
int y;
@@ -25,7 +26,7 @@ public class Building implements GameObject {
TOWNHALL, REPAIRSHOP, UPGRADESHOP, POLICESTATION, HOUSE
}
- public Building(Structure thisBuilding, int newX, int newY) {
+ public Building(Structure thisBuilding, int newX, int newY, DroneTeam team) {
structure = thisBuilding;
switch (structure) {
case TOWNHALL: {
@@ -50,6 +51,7 @@ public class Building implements GameObject {
}
}
+ this.team = team;
x = newX;
y = newY;
}
@@ -68,6 +70,20 @@ public class Building implements GameObject {
return structure;
}
+ /**
+ * Retrieve the name of the team that owns the current building. If the
+ * building is a public building, the string will be "Public".
+ *
+ * @return String
+ */
+ public String getTeam() {
+ if (structure == Structure.HOUSE) {
+ return team.getName();
+ } else {
+ return "Public";
+ }
+ }
+
/**
* Retrieve x index
*
diff --git a/src/net/grosinger/nomads/NeighborBuilding.java b/src/net/grosinger/nomads/NeighborBuilding.java
index f5b8dc6..046907d 100644
--- a/src/net/grosinger/nomads/NeighborBuilding.java
+++ b/src/net/grosinger/nomads/NeighborBuilding.java
@@ -62,6 +62,16 @@ public class NeighborBuilding implements GameObject {
return building.getType();
}
+ /**
+ * Retrieve the name of the team that owns the current building. If the
+ * building is a public building, the string will be "Public".
+ *
+ * @return String
+ */
+ public String getTeam() {
+ return building.getTeam();
+ }
+
@Override
public void setName(String newName) {
name = newName;