Microscopic Traffic Simulator
BackwardCarCellWalker.cs
Go to the documentation of this file.
1 using System.Collections.Generic;
2 
3 namespace Microscopic_Traffic_Simulator___Model.CellularTopologyObjects.CellWalkers
4 {
9  {
13  private Car car;
14 
20  internal BackwardCarCellWalker(Cell cell, Car car)
21  : base(cell)
22  {
23  this.car = car;
24  }
25 
30  internal override IEnumerable<Cell> GetNext()
31  {
32  foreach (Cell cell in base.GetNext())
33  {
34  if (cell.Car == car)
35  {
36  yield return cell;
37  }
38  else
39  {
40  yield break;
41  }
42  }
43  }
44  }
45 }