MineLittlePony/src/main/java/com/minelittlepony/model/ModelWrapper.java

35 lines
732 B
Java
Raw Normal View History

2016-11-17 05:45:04 +01:00
package com.minelittlepony.model;
2015-08-02 00:36:33 +02:00
import com.minelittlepony.model.armour.PonyArmor;
import com.minelittlepony.pony.data.IPonyData;
2015-11-17 06:09:04 +01:00
public class ModelWrapper {
2015-08-02 00:36:33 +02:00
2015-12-16 05:29:47 +01:00
private final AbstractPonyModel model;
private final PonyArmor armor;
public ModelWrapper(AbstractPonyModel model) {
2015-08-02 00:36:33 +02:00
this.model = model;
this.armor = model.createArmour();
this.armor.apply(model.metadata);
2015-08-02 00:36:33 +02:00
}
2015-12-16 05:29:47 +01:00
public AbstractPonyModel getModel() {
return model;
2015-08-02 00:36:33 +02:00
}
public void init() {
model.init(0, 0);
armor.init();
2015-08-02 00:36:33 +02:00
}
public PonyArmor getArmor() {
return armor;
2015-08-02 00:36:33 +02:00
}
2016-11-25 05:40:19 +01:00
public void apply(IPonyData meta) {
model.metadata = meta;
armor.apply(meta);
2015-08-02 00:36:33 +02:00
}
}