mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2024-11-29 15:37:59 +01:00
24 lines
609 B
Java
24 lines
609 B
Java
package com.minelittlepony.api.pony;
|
|
|
|
import java.util.List;
|
|
|
|
public class TriggerPixelSet<T extends Enum<T> & TriggerPixelType<T>> extends TriggerPixelValue<boolean[]> {
|
|
|
|
private final T def;
|
|
|
|
public TriggerPixelSet(int color, T def, boolean[] value) {
|
|
super(color, value);
|
|
this.def = def;
|
|
}
|
|
|
|
@SuppressWarnings("unchecked")
|
|
@Override
|
|
public List<TriggerPixelType<T>> getOptions() {
|
|
return def.getOptions();
|
|
}
|
|
|
|
@Override
|
|
public boolean matches(Object o) {
|
|
return o.getClass() == def.getClass() && getValue()[((Enum<?>)o).ordinal()];
|
|
}
|
|
}
|