2018-06-05 20:18:57 +02:00
|
|
|
package com.minelittlepony.pony.data;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
public enum PonyWearable implements ITriggerPixelMapped<PonyWearable> {
|
|
|
|
NONE(0),
|
2018-06-08 01:03:21 +02:00
|
|
|
SADDLE_BAGS(255),
|
|
|
|
HAT(100);
|
2018-06-05 20:18:57 +02:00
|
|
|
|
|
|
|
private int triggerValue;
|
|
|
|
|
|
|
|
PonyWearable(int pixel) {
|
|
|
|
triggerValue = pixel;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public int getTriggerPixel() {
|
|
|
|
return triggerValue;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static PonyWearable[] flags(boolean[] flags) {
|
|
|
|
List<PonyWearable> wears = new ArrayList<PonyWearable>();
|
|
|
|
PonyWearable[] values = values();
|
2018-06-05 20:20:06 +02:00
|
|
|
for (int i = 0; i < values.length; i++) {
|
2018-06-05 20:18:57 +02:00
|
|
|
if (flags[i]) wears.add(values[i]);
|
|
|
|
}
|
|
|
|
return wears.toArray(new PonyWearable[wears.size()]);
|
|
|
|
}
|
|
|
|
}
|