Skip to content

Commit 3399d4b

Browse files
committed
Further code cleanup
1 parent 8eea009 commit 3399d4b

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

Source/Orts.Simulation/MultiPlayer/Message.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3901,7 +3901,7 @@ public override string ToString()
39013901
public class MSGMovingTbl : Message
39023902
{
39033903
private string user;
3904-
private MovingTable.subMessageCode subMessageCode;
3904+
private MovingTable.SubMessageCode subMessageCode;
39053905
private int movingTableIndex;
39063906
private bool clockwise;
39073907
private float yangle;
@@ -3912,13 +3912,13 @@ public MSGMovingTbl(string m)
39123912

39133913
movingTableIndex = int.Parse(areas[0].Trim());
39143914
user = areas[1].Trim();
3915-
subMessageCode = (MovingTable.subMessageCode)int.Parse(areas[2].Trim());
3915+
subMessageCode = (MovingTable.SubMessageCode)int.Parse(areas[2].Trim());
39163916
clockwise = int.Parse(areas[3].Trim()) == 0 ? false : true;
39173917
yangle = float.Parse(areas[4].Trim());
39183918

39193919
}
39203920

3921-
public MSGMovingTbl(int mti, string u, MovingTable.subMessageCode smc, bool cw, float y)
3921+
public MSGMovingTbl(int mti, string u, MovingTable.SubMessageCode smc, bool cw, float y)
39223922
{
39233923
movingTableIndex = mti;
39243924
user = u;
@@ -3943,7 +3943,7 @@ public override void HandleMsg()
39433943
{
39443944
switch (subMessageCode)
39453945
{
3946-
case MovingTable.subMessageCode.GoToTarget:
3946+
case MovingTable.SubMessageCode.GoToTarget:
39473947
turntable.RemotelyControlled = true;
39483948
if (Math.Abs(MathHelper.WrapAngle(turntable.YAngle - yangle)) > 0.2f)
39493949
{
@@ -3953,7 +3953,7 @@ public override void HandleMsg()
39533953
}
39543954
turntable.GeneralComputeTarget(clockwise);
39553955
break;
3956-
case MovingTable.subMessageCode.StartingContinuous:
3956+
case MovingTable.SubMessageCode.StartingContinuous:
39573957
turntable.YAngle = yangle;
39583958
turntable.TargetY = yangle;
39593959
turntable.AlignToRemote = true;
@@ -3967,7 +3967,7 @@ public override void HandleMsg()
39673967
{
39683968
switch (subMessageCode)
39693969
{
3970-
case MovingTable.subMessageCode.GoToTarget:
3970+
case MovingTable.SubMessageCode.GoToTarget:
39713971
transfertable.RemotelyControlled = true;
39723972
if (Math.Abs(transfertable.OffsetPos - yangle) > 2.8f)
39733973
{
@@ -3977,7 +3977,7 @@ public override void HandleMsg()
39773977
}
39783978
transfertable.GeneralComputeTarget(clockwise);
39793979
break;
3980-
case MovingTable.subMessageCode.StartingContinuous:
3980+
case MovingTable.SubMessageCode.StartingContinuous:
39813981
transfertable.OffsetPos = yangle;
39823982
transfertable.TargetOffset = yangle;
39833983
transfertable.AlignToRemote = true;

Source/Orts.Simulation/Simulation/Transfertables.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,8 @@ public override void ComputeTarget(bool isForward)
180180
if (!Continuous) return;
181181
if (MultiPlayer.MPManager.IsMultiPlayer())
182182
{
183-
SubMessageCode = subMessageCode.GoToTarget;
184-
MultiPlayer.MPManager.Notify(new MultiPlayer.MSGMovingTbl(Simulator.ActiveMovingTableIndex, Orts.MultiPlayer.MPManager.GetUserName(), SubMessageCode, isForward, OffsetPos).ToString());
183+
SubMessCode = SubMessageCode.GoToTarget;
184+
MultiPlayer.MPManager.Notify(new MultiPlayer.MSGMovingTbl(Simulator.ActiveMovingTableIndex, Orts.MultiPlayer.MPManager.GetUserName(), SubMessCode, isForward, OffsetPos).ToString());
185185
}
186186
RemotelyControlled = false;
187187
GeneralComputeTarget(isForward);
@@ -280,8 +280,8 @@ public override void StartContinuous(bool isForward)
280280
}
281281
if (MultiPlayer.MPManager.IsMultiPlayer())
282282
{
283-
SubMessageCode = subMessageCode.StartingContinuous;
284-
MultiPlayer.MPManager.Notify(new MultiPlayer.MSGMovingTbl(Simulator.ActiveMovingTableIndex, Orts.MultiPlayer.MPManager.GetUserName(), SubMessageCode, isForward, OffsetPos).ToString());
283+
SubMessCode = SubMessageCode.StartingContinuous;
284+
MultiPlayer.MPManager.Notify(new MultiPlayer.MSGMovingTbl(Simulator.ActiveMovingTableIndex, Orts.MultiPlayer.MPManager.GetUserName(), SubMessCode, isForward, OffsetPos).ToString());
285285
}
286286
GeneralStartContinuous(isForward);
287287
}

Source/Orts.Simulation/Simulation/Turntables.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public class MovingTable
8181
protected int[] MyTrVectorSectionsIndex;
8282
public bool[] MyTrackNodesOrientation { get; protected set; } // true if forward, false if backward
8383
public int TrackShapeIndex;
84-
public enum subMessageCode
84+
public enum SubMessageCode
8585
{
8686
GoToTarget,
8787
StartingContinuous,
@@ -108,7 +108,7 @@ public enum subMessageCode
108108
public Vector3 FinalFrontTravellerXNALocation;
109109
public Vector3 FinalRearTravellerXNALocation;
110110
public Simulator Simulator;
111-
public subMessageCode SubMessageCode;
111+
public SubMessageCode SubMessCode;
112112
public bool AlignToRemote;
113113
public bool RemotelyControlled;
114114

@@ -485,8 +485,8 @@ public override void ComputeTarget(bool isClockwise)
485485
if (!Continuous) return;
486486
if (MultiPlayer.MPManager.IsMultiPlayer())
487487
{
488-
SubMessageCode = subMessageCode.GoToTarget;
489-
MultiPlayer.MPManager.Notify(new MultiPlayer.MSGMovingTbl(Simulator.ActiveMovingTableIndex, Orts.MultiPlayer.MPManager.GetUserName(), SubMessageCode, isClockwise, YAngle).ToString());
488+
SubMessCode = SubMessageCode.GoToTarget;
489+
MultiPlayer.MPManager.Notify(new MultiPlayer.MSGMovingTbl(Simulator.ActiveMovingTableIndex, Orts.MultiPlayer.MPManager.GetUserName(), SubMessCode, isClockwise, YAngle).ToString());
490490
}
491491
RemotelyControlled = false;
492492
GeneralComputeTarget(isClockwise);
@@ -628,8 +628,8 @@ public override void StartContinuous(bool isClockwise)
628628
}
629629
if (MultiPlayer.MPManager.IsMultiPlayer())
630630
{
631-
SubMessageCode = subMessageCode.StartingContinuous;
632-
MultiPlayer.MPManager.Notify(new MultiPlayer.MSGMovingTbl(Simulator.ActiveMovingTableIndex, Orts.MultiPlayer.MPManager.GetUserName(), SubMessageCode, isClockwise, YAngle).ToString());
631+
SubMessCode = SubMessageCode.StartingContinuous;
632+
MultiPlayer.MPManager.Notify(new MultiPlayer.MSGMovingTbl(Simulator.ActiveMovingTableIndex, Orts.MultiPlayer.MPManager.GetUserName(), SubMessCode, isClockwise, YAngle).ToString());
633633
}
634634
GeneralStartContinuous(isClockwise);
635635
}

0 commit comments

Comments
 (0)