Microscopic Traffic Simulator
BackwardCellWalker.cs
Go to the documentation of this file.
1 using System.Collections.Generic;
2 
3 namespace Microscopic_Traffic_Simulator___Model.CellularTopologyObjects.CellWalkers
4 {
9  {
14  internal BackwardCellWalker(Cell cell) : base(cell) { }
15 
20  internal override IEnumerable<Cell> GetNext()
21  {
22  if (cell != null)
23  {
24  yield return cell;
25  while (cell.PreviousCell != null)
26  {
27  cell = cell.PreviousCell;
28  yield return cell;
29  }
30  }
31  }
32  }
33 }
Abstract class for returning cells by walking through topology.
Definition: CellWalker.cs:8