Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 3c13edc4 authored by Michael KRISPER's avatar Michael KRISPER
Browse files

GearshiftPositions: Corrected bug for HasPredecessor/HasSuccessor when GearPosition is 0

parent e6e7e834
No related branches found
No related tags found
No related merge requests found
......@@ -88,7 +88,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
public GearList(GearshiftPosition[] gearList) => Entries = gearList;
public bool HasPredecessor(GearshiftPosition cur) => cur != Entries[0];
public bool HasPredecessor(GearshiftPosition cur) => cur.Gear != 0 && cur != Entries[0];
public GearshiftPosition Predecessor(GearshiftPosition cur)
{
......@@ -96,7 +96,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
return idx <= 0 ? null : Entries[idx - 1];
}
public bool HasSuccessor(GearshiftPosition cur) => cur != Entries[Entries.Length-1];
public bool HasSuccessor(GearshiftPosition cur) => cur.Gear != 0 && cur != Entries[Entries.Length-1];
public GearshiftPosition Successor(GearshiftPosition cur)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment