2018-04-25 16:40:47 +02:00
|
|
|
package com.minelittlepony.model.player;
|
|
|
|
|
|
|
|
import com.minelittlepony.model.PMAPI;
|
|
|
|
import com.minelittlepony.model.ModelWrapper;
|
2018-04-24 14:55:32 +02:00
|
|
|
|
2018-04-24 17:12:23 +02:00
|
|
|
public enum PlayerModels {
|
2018-04-28 16:39:32 +02:00
|
|
|
/**
|
|
|
|
* @deprecated Will be removed in a later revision
|
|
|
|
*/
|
|
|
|
@Deprecated HUMAN("default", "slim", () -> PMAPI.pony, () -> PMAPI.ponySmall),
|
|
|
|
EARTH("earthpony", "slimearthpony", () -> PMAPI.earthpony, () -> PMAPI.earthponySmall),
|
|
|
|
PEGASUS("pegasus", "slimpegasus", () -> PMAPI.pegasus, () -> PMAPI.pegasusSmall),
|
2018-05-11 20:20:10 +02:00
|
|
|
UNICORN("unicorn", "slimunicorn", () -> PMAPI.unicorn, () -> PMAPI.unicornSmall),
|
2018-04-30 14:10:30 +02:00
|
|
|
ALICORN("alicorn", "slimalicorn", () -> PMAPI.alicorn, () -> PMAPI.alicornSmall),
|
|
|
|
ZEBRA("zebra", "slimzebra", () -> PMAPI.zebra, () -> PMAPI.zebraSmall);
|
2018-04-24 17:12:23 +02:00
|
|
|
|
|
|
|
private final ModelResolver normal, slim;
|
|
|
|
|
|
|
|
private final String normalKey, slimKey;
|
|
|
|
|
|
|
|
PlayerModels(String normalKey, String slimKey, ModelResolver normal, ModelResolver slim) {
|
|
|
|
this.normalKey = normalKey;
|
|
|
|
this.slimKey = slimKey;
|
|
|
|
|
|
|
|
this.normal = normal;
|
|
|
|
this.slim = slim;
|
|
|
|
}
|
|
|
|
|
2018-04-25 16:40:47 +02:00
|
|
|
public ModelWrapper getModel(boolean slim) {
|
2018-04-28 16:39:32 +02:00
|
|
|
return slim ? this.slim.resolve() : normal.resolve();
|
2018-04-24 17:12:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public String getId(boolean useSlimArms) {
|
2018-04-28 16:39:32 +02:00
|
|
|
return useSlimArms ? slimKey : normalKey;
|
2018-04-24 17:12:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* FIXME: PMAPI fields are null when the game starts.
|
|
|
|
*/
|
|
|
|
static interface ModelResolver {
|
2018-04-25 16:40:47 +02:00
|
|
|
ModelWrapper resolve();
|
2018-04-24 17:12:23 +02:00
|
|
|
}
|
2018-04-24 14:55:32 +02:00
|
|
|
}
|