public SharedTrain(SharedRailManager manager, RailcarModel engineModel, TrackPosition position, Direction direction = Direction.Forward) { RailManager = manager; manager.Trains.Add(this); Railcars = new List <SharedRailcar>(); Direction = direction; }
/// <summary> /// Get a new track position from an old one and an added distance /// </summary> /// <param name="position"></param> /// <param name="addedDistance"></param> /// <returns>The new position</returns> public static TrackPosition AddDistance(TrackPosition position, float addedDistance) { return(new TrackPosition(position.Node, position.Direction, position.Distance + addedDistance)); }
public SharedRailcar(SharedTrain train, RailcarModel model, TrackPosition position) { Train = train; Model = model; FrontPosition = position; }