MineLittlePony/src/main/java/com/minelittlepony/api/pony/IPonyData.java

81 lines
2 KiB
Java
Raw Normal View History

2020-04-03 23:54:12 +02:00
package com.minelittlepony.api.pony;
2016-11-24 02:01:23 -05:00
import org.jetbrains.annotations.Nullable;
import com.google.common.collect.ComparisonChain;
2022-12-11 00:05:31 +00:00
import com.minelittlepony.api.pony.meta.*;
2020-04-16 23:35:28 +02:00
import com.minelittlepony.common.util.animation.Interpolator;
import java.util.Arrays;
import java.util.Map;
import java.util.UUID;
2016-11-24 02:01:23 -05:00
/**
* Metadata for a pony.
2016-11-24 02:01:23 -05:00
*/
public interface IPonyData extends Comparable<IPonyData> {
/**
* Gets this pony's race.
*
* This is the actual race value. For the effective race, prefer going through {@link IPony#race}
*/
2019-03-23 21:49:34 +02:00
Race getRace();
2016-11-24 02:01:23 -05:00
/**
* Gets the length of the pony's tail.
*/
2022-12-11 00:05:31 +00:00
TailLength getTailLength();
/**
* Gets the shape of the pony's tail.
*/
TailShape getTailShape();
/**
* Get the pony's gender (usually female).
*/
2019-03-23 21:49:34 +02:00
Gender getGender();
/**
* Gets the current pony size.
*/
2019-03-23 21:49:34 +02:00
Size getSize();
/**
* Gets the magical glow colour for magic-casting races. Returns 0 otherwise.
*/
int getGlowColor();
/**
* Returns an array of wearables that this pony is carrying.
*/
Wearable[] getGear();
/**
* Checks it this pony is wearing the given accessory.
*/
2019-03-23 21:49:34 +02:00
boolean isWearing(Wearable wearable);
/**
* Gets an interpolator for interpolating values.
*/
2020-04-16 23:35:28 +02:00
Interpolator getInterpolator(UUID interpolatorId);
/**
* Gets the trigger pixel values as they appeared in the underlying image.
*/
Map<String, TriggerPixelType<?>> getTriggerPixels();
@Override
default int compareTo(@Nullable IPonyData o) {
return o == this ? 0 : o == null ? 1 : ComparisonChain.start()
.compare(getRace(), o.getRace())
2022-12-11 00:05:31 +00:00
.compare(getTailLength(), o.getTailLength())
.compare(getGender(), o.getGender())
.compare(getSize().ordinal(), o.getSize().ordinal())
.compare(getGlowColor(), o.getGlowColor())
.compare(0, Arrays.compare(getGear(), o.getGear()))
.result();
}
2016-11-24 02:01:23 -05:00
}