blob: 9ea0fd148ecbb0c547de9bc919955756d799d227 [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 object(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 add(StoredObject object) {
storedObjects.add(object);
}
}