Idea pass on model generation
This commit is contained in:
parent
001dd9ac74
commit
046fcba860
3 changed files with 88 additions and 3 deletions
|
@ -0,0 +1,48 @@
|
|||
package techreborn.build.model;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
public class MachineModelBuilder {
|
||||
|
||||
private ModelBuilder.Model model;
|
||||
Consumer<MachineTextures> textureConsumer;
|
||||
|
||||
MachineModelBuilder(ModelBuilder.Model model, Consumer<MachineTextures> textureConsumer) {
|
||||
this.model = model;
|
||||
this.textureConsumer = textureConsumer;
|
||||
}
|
||||
|
||||
public List<ModelBuilder.Component> getComponents(){
|
||||
//Loads the textures in
|
||||
MachineTextures textures = new MachineTextures(this);
|
||||
textureConsumer.accept(textures);
|
||||
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
public static class MachineTextures {
|
||||
|
||||
MachineModelBuilder modelBuilder;
|
||||
|
||||
public String top_off;
|
||||
public String top_on;
|
||||
|
||||
|
||||
public String front_off;
|
||||
public String front_on;
|
||||
|
||||
public String side_off;
|
||||
public String side_on;
|
||||
|
||||
public String bottom_off;
|
||||
public String bottom_on;
|
||||
|
||||
public MachineTextures(MachineModelBuilder modelBuilder) {
|
||||
this.modelBuilder = modelBuilder;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -3,6 +3,7 @@ package techreborn.build.model;
|
|||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
public class ModelBuilder {
|
||||
|
||||
|
@ -27,14 +28,25 @@ public class ModelBuilder {
|
|||
public static class Model {
|
||||
String name;
|
||||
ModelBuilder modelBuilder;
|
||||
List<Component> components = new ArrayList<>();
|
||||
|
||||
|
||||
private Model(String name, ModelBuilder modelBuilder) {
|
||||
this.name = name;
|
||||
this.modelBuilder = modelBuilder;
|
||||
}
|
||||
|
||||
public Model machine(Consumer<MachineModelBuilder.MachineTextures> textureConsumer){
|
||||
components.addAll(new MachineModelBuilder(this, textureConsumer).getComponents());
|
||||
return this;
|
||||
}
|
||||
|
||||
public ModelBuilder build(){
|
||||
return modelBuilder;
|
||||
}
|
||||
}
|
||||
|
||||
public static abstract class Component {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue