+ There are no rail systems. +
+ + +- * |-segment A-|-segment B-| - * ===================== <- Rail - * ]+ ---> Signal is facing East, and shows status on - * its western side. It is connected to segment B. - *- */ - @Enumerated(EnumType.STRING) - private Direction direction; - /** * The segment that this signal connects to. */ @ManyToOne(optional = false, fetch = FetchType.LAZY) private Segment segment; - public Signal(RailSystem railSystem, Position position, String name, Segment segment, Direction direction) { - super(railSystem, position, name); + public Signal(RailSystem railSystem, Position position, String name, Segment segment) { + super(railSystem, position, name, ComponentType.SIGNAL); this.segment = segment; - this.direction = direction; } } diff --git a/src/main/java/nl/andrewl/railsignalapi/model/component/Switch.java b/src/main/java/nl/andrewl/railsignalapi/model/component/Switch.java index afa8c80..ce3b1e9 100644 --- a/src/main/java/nl/andrewl/railsignalapi/model/component/Switch.java +++ b/src/main/java/nl/andrewl/railsignalapi/model/component/Switch.java @@ -3,6 +3,8 @@ package nl.andrewl.railsignalapi.model.component; import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; +import lombok.Setter; +import nl.andrewl.railsignalapi.model.RailSystem; import javax.persistence.*; import java.util.Set; @@ -22,8 +24,16 @@ public class Switch extends PathNode { private Set
Stay in control of your rails.
- -