aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/api/objects/data
diff options
context:
space:
mode:
authorAlkalus <3060479+draknyte1@users.noreply.github.com>2018-05-27 16:16:10 +1000
committerAlkalus <3060479+draknyte1@users.noreply.github.com>2018-05-27 16:16:10 +1000
commit4cbc4b40b3e1d5197b6e390311472fffcf4bec21 (patch)
treec84f47cf4a7a6a82dbb92c02123cc7b18c14f19d /src/Java/gtPlusPlus/api/objects/data
parent79f37cfd42c53af7969fba388b711955e389b76d (diff)
downloadGT5-Unofficial-4cbc4b40b3e1d5197b6e390311472fffcf4bec21.tar.gz
GT5-Unofficial-4cbc4b40b3e1d5197b6e390311472fffcf4bec21.tar.bz2
GT5-Unofficial-4cbc4b40b3e1d5197b6e390311472fffcf4bec21.zip
$ Hopefully fixed issue where BoP limestone is valid for Fluorite.
$ Fixed the ABS not using the correct texture on the top layer input hatch. % More internal work on LFTR rewrite.
Diffstat (limited to 'src/Java/gtPlusPlus/api/objects/data')
-rw-r--r--src/Java/gtPlusPlus/api/objects/data/AutoMap.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/Java/gtPlusPlus/api/objects/data/AutoMap.java b/src/Java/gtPlusPlus/api/objects/data/AutoMap.java
index 7ffa2deb42..b3762dd243 100644
--- a/src/Java/gtPlusPlus/api/objects/data/AutoMap.java
+++ b/src/Java/gtPlusPlus/api/objects/data/AutoMap.java
@@ -9,6 +9,7 @@ public class AutoMap<V> implements Iterable<V>, Cloneable, Serializable {
* The Internal Map
*/
protected final Map<Integer, V> mInternalMap;
+ protected final Map<String, Integer> mInternalNameMap;
/**
* The Internal ID
@@ -23,6 +24,7 @@ public class AutoMap<V> implements Iterable<V>, Cloneable, Serializable {
public AutoMap(Map<Integer, V> defaultMapType) {
mInternalMap = defaultMapType;
+ mInternalNameMap = new HashMap<String, Integer>();
}
@Override
@@ -46,6 +48,7 @@ public class AutoMap<V> implements Iterable<V>, Cloneable, Serializable {
}
public synchronized V set(V object){
+ mInternalNameMap.put(""+object.hashCode(), (mInternalID+1));
return mInternalMap.put(mInternalID++, object);
}
@@ -93,5 +96,12 @@ public class AutoMap<V> implements Iterable<V>, Cloneable, Serializable {
public synchronized final int getInternalID() {
return mInternalID;
}
+
+ public synchronized final boolean remove(V value) {
+ if (this.mInternalMap.containsValue(value)) {
+ return this.mInternalMap.remove(mInternalNameMap.get(""+value.hashCode()), value);
+ }
+ return false;
+ }
}