Browse Source

zone loading

lakebane-master
FatBoy-DOTC 8 months ago
parent
commit
3c5f510969
  1. 59
      src/engine/objects/Mine.java

59
src/engine/objects/Mine.java

@ -81,38 +81,41 @@ public class Mine extends AbstractGameObject {
this.buildingID = rs.getInt("mine_buildingUID"); this.buildingID = rs.getInt("mine_buildingUID");
this.flags = rs.getInt("flags"); this.flags = rs.getInt("flags");
//int parent = rs.getInt("parent"); //int parent = rs.getInt("parent");
Building tower = BuildingManager.getBuildingFromCache(rs.getInt("mine_buildingUID")); if(BuildingManager.getBuildingFromCache(rs.getInt("mine_buildingUID")) != null) {
for(Zone zone : ZoneManager.getAllZonesIn(tower.loc)){ Building tower = BuildingManager.getBuildingFromCache(rs.getInt("mine_buildingUID"));
if(zone.isMacroZone()) {
this.parentZone = zone; for (Zone zone : ZoneManager.getAllZonesIn(tower.loc)) {
this.zoneName = this.parentZone.getParent().getName(); if (zone.isMacroZone()) {
this.parentZone = zone;
this.zoneName = this.parentZone.getParent().getName();
}
} }
}
this.owningGuild = Guild.getGuild(ownerUID); this.owningGuild = Guild.getGuild(ownerUID);
Guild nation = null; Guild nation = null;
if (this.owningGuild.isEmptyGuild()) {
this.guildName = "";
this.guildTag = GuildTag.ERRANT;
nation = Guild.getErrantGuild();
this.owningGuild = Guild.getErrantGuild();
} else {
this.guildName = this.owningGuild.getName();
this.guildTag = this.owningGuild.getGuildTag();
nation = this.owningGuild.getNation();
}
if (this.owningGuild.isEmptyGuild()) { if (!nation.isEmptyGuild()) {
this.guildName = ""; this.nationName = nation.getName();
this.guildTag = GuildTag.ERRANT; this.nationTag = nation.getGuildTag();
nation = Guild.getErrantGuild(); } else {
this.owningGuild = Guild.getErrantGuild(); this.nationName = "";
} else { this.nationTag = GuildTag.ERRANT;
this.guildName = this.owningGuild.getName(); }
this.guildTag = this.owningGuild.getGuildTag();
nation = this.owningGuild.getNation();
}
if (!nation.isEmptyGuild()) { this.production = Resource.valueOf(rs.getString("mine_resource"));
this.nationName = nation.getName(); this.lastClaimer = null;
this.nationTag = nation.getGuildTag();
} else {
this.nationName = "";
this.nationTag = GuildTag.ERRANT;
} }
this.production = Resource.valueOf(rs.getString("mine_resource"));
this.lastClaimer = null;
} }
public static void SetTimes(){ public static void SetTimes(){
@ -150,7 +153,7 @@ public class Mine extends AbstractGameObject {
AmericaMines.get(10).liveTime = 1; AmericaMines.get(10).liveTime = 1;
AmericaMines.get(11).liveTime = 1; AmericaMines.get(11).liveTime = 1;
AmericaMines.get(12).liveTime = 1; AmericaMines.get(12).liveTime = 1;
AmericaMines.get(13).liveTime = 1; //AmericaMines.get(13).liveTime = 1;
int count = 1; int count = 1;

Loading…
Cancel
Save