public void RemoveConnection() { IsConnectedRight = false; TempCar = RightCar.RollingStock; RightCar.LeftCar = null; RightCar = null; CouplerRight.DestroyCouplerConnection(); CouplerPointRight.DestroyPointConnection(); }
public void InitConnection(RSConnection otherCar) { IsConnectedRight = true; RightCar = otherCar; RightCar.LeftCar = this; // this coupler is in connection CouplerRight.MakeCouplerConnection(); CouplerPointRight.MakePointConnection(otherCar); }
public void DestroyConnection() { CompositionManager.Instance.UpdateCompositionsAfterUncoupling(RightCar.RollingStock); IsConnectedRight = false; JustUncoupled = true; TempCar = RightCar.RollingStock; tempDist = TempCar.OwnRun - RollingStock.OwnRun; RightCar.LeftCar = null; RightCar = null; CouplerRight.DestroyCouplerConnection(); CouplerPointRight.DestroyPointConnection(); }
public void MakeConnection(RSConnection otherCar) { IsConnectedRight = true; RightCar = otherCar; RightCar.LeftCar = this; // this coupler is in connection CouplerRight.MakeCouplerConnection(); CouplerPointRight.MakePointConnection(otherCar); // make new comp from two CompositionManager.Instance.UpdateCompositionsAfterCoupling(RollingStock, RightCar.RollingStock); //for coupler indication EventManager.CarsCoupled(); }