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.
51 lines
690 B
51 lines
690 B
package mightypork.gamecore.eventbus.clients;
|
|
|
|
|
|
import java.util.Collection;
|
|
|
|
import mightypork.gamecore.gui.Enableable;
|
|
|
|
|
|
/**
|
|
* Basic 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;
|
|
}
|
|
}
|
|
|