diff --git a/ProjectElectricLocomotive/src/CollectionGenericObjects/StorageCollection.java b/ProjectElectricLocomotive/src/CollectionGenericObjects/StorageCollection.java index 573febc..4495ae4 100644 --- a/ProjectElectricLocomotive/src/CollectionGenericObjects/StorageCollection.java +++ b/ProjectElectricLocomotive/src/CollectionGenericObjects/StorageCollection.java @@ -27,7 +27,13 @@ public class StorageCollection { } } + public T GetShip(String name, int ind){ + if (name == null || !storage.containsKey(name)) return null; + return storage.get(name).get(ind); + } + public void delCollection(String name) { + if(!storage.containsKey(name)) return; storage.remove(name); }