示例#1
0
 public SharedTrain(SharedRailManager manager, RailcarModel engineModel, TrackPosition position, Direction direction = Direction.Forward)
 {
     RailManager = manager;
     manager.Trains.Add(this);
     Railcars  = new List <SharedRailcar>();
     Direction = direction;
 }
示例#2
0
 /// <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));
 }
示例#3
0
 public SharedRailcar(SharedTrain train, RailcarModel model, TrackPosition position)
 {
     Train         = train;
     Model         = model;
     FrontPosition = position;
 }