Collection of useful utilities for Java games and apps. A lot of interesting utilities that could maybe still find some use if you work with Java...
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mightyutils/src/mightypork/utils/eventbus/clients/DelegatingList.java

52 lines
725 B

package mightypork.utils.eventbus.clients;
import java.util.Collection;
import mightypork.utils.interfaces.Enableable;
/**
* List of clients, that can be used as a delegating client.
*
* @author Ondřej Hruška (MightyPork)
*/
public class DelegatingList extends ClientList implements DelegatingClient, Enableable {
private boolean enabled = true;
public DelegatingList(Object... clients)
{
super(clients);
}
@Override
public Collection<?> getChildClients()
{
return this;
}
@Override
public boolean doesDelegate()
{
return isEnabled();
}
@Override
public void setEnabled(boolean yes)
{
enabled = yes;
}
@Override
public boolean isEnabled()
{
return enabled;
}
}