Fix CME when cleaning Factions from the board. Fixes #515

This commit is contained in:
eueln 2015-08-28 13:41:08 -04:00
parent 0ede00f7df
commit 9de87fc2a2

View File

@ -49,8 +49,11 @@ public abstract class MemoryBoard extends Board {
return factionToLandMap.get(factionId).size(); return factionToLandMap.get(factionId).size();
} }
public Collection<FLocation> getOwnedLand(String factionId) { public void removeFaction(String factionId) {
return factionToLandMap.get(factionId); Collection<FLocation> flocations = factionToLandMap.removeAll(factionId);
for (FLocation floc : flocations) {
super.remove(floc);
}
} }
} }
@ -131,10 +134,7 @@ public abstract class MemoryBoard extends Board {
} }
public void clean(String factionId) { public void clean(String factionId) {
Collection<FLocation> keys = flocationIds.getOwnedLand(factionId); flocationIds.removeFaction(factionId);
for (FLocation key : keys) {
flocationIds.remove(key);
}
} }
// Is this coord NOT completely surrounded by coords claimed by the same faction? // Is this coord NOT completely surrounded by coords claimed by the same faction?