Skip to content

Commit

Permalink
Clean up frame valve gear configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
cam72cam committed Dec 9, 2023
1 parent 2e1f12f commit b3a15b7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import cam72cam.immersiverailroading.ConfigSound;
import cam72cam.immersiverailroading.entity.EntityMoveableRollingStock;
import cam72cam.immersiverailroading.gui.overlay.Readouts;
import cam72cam.immersiverailroading.library.Gauge;
import cam72cam.immersiverailroading.library.ModelComponentType;
import cam72cam.immersiverailroading.library.ModelComponentType.ModelPosition;
import cam72cam.immersiverailroading.model.animation.StockAnimation;
Expand Down Expand Up @@ -210,7 +209,7 @@ protected void parseControllable(ComponentProvider provider, DEFINITION def) {
}

protected void parseComponents(ComponentProvider provider, DEFINITION def) {
this.frame = new Frame(provider, base, rocking, def.defID, def.getValveGear());
this.frame = new Frame(provider, base, rocking, def.defID);

drivingWheels = DrivingAssembly.get(def.getValveGear(), provider, base, 0,
frame != null ? frame.wheels : null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,15 @@
import cam72cam.immersiverailroading.model.components.ModelComponent;

public class Frame {
private final ModelComponent frame;
public final WheelSet wheels;
private final ValveGear valveGearRight;
private final ValveGear valveGearLeft;

public Frame(ComponentProvider provider, ModelState state, ModelState rocking, String blame, ValveGearConfig type) {
public Frame(ComponentProvider provider, ModelState state, ModelState rocking, String blame) {
this.wheels = WheelSet.get(provider, state, ModelComponentType.FRAME_WHEEL_X, 0);
this.frame = provider.parse(ModelComponentType.FRAME);
ModelComponent frame = provider.parse(ModelComponentType.FRAME);
if (frame == null) {
ImmersiveRailroading.warn("Invalid model: Missing FRAME for %s! (this will fail in future versions of IR)", blame);
} else {
rocking.include(frame);
}
valveGearRight = wheels != null ? ValveGear.get(wheels, type, provider, state, ModelPosition.RIGHT, -90) : null;
valveGearLeft = wheels != null ? ValveGear.get(wheels, type, provider, state, ModelPosition.LEFT, 0) : null;
}
}

0 comments on commit b3a15b7

Please sign in to comment.