blob: a1cd9796834c38de6bab587cbe0d1ae98d060bb3 [file] [log] [blame] [raw]
package us.myles.ViaVersion2.api.data;
import java.util.ArrayList;
import java.util.List;
public class UserConnection {
List<StoredObject> storedObjects = new ArrayList<>();
public <T extends StoredObject> T get(Class<T> objectClass) {
for (StoredObject o : storedObjects) {
if (o.getClass().equals(objectClass))
return (T) o;
}
return null;
}
public <T extends StoredObject> boolean has(Class<T> objectClass) {
for (StoredObject o : storedObjects) {
if (o.getClass().equals(objectClass))
return true;
}
return false;
}
public void put(StoredObject object) {
storedObjects.add(object);
}
}