Microscopic Traffic Simulator
LimitedMinimumStepsCellWalker.cs
Go to the documentation of this file.
1 using System.Collections.Generic;
2 
3 namespace Microscopic_Traffic_Simulator___Model.CellularTopologyObjects.CellWalkers
4 {
11  {
15  private Cell lastCell;
19  internal Cell LastCell { get { return lastCell; } }
20 
26  internal LimitedMinimumStepsCellWalker(CellWalker cellWalker, int max) :
27  base(cellWalker, max) { }
28 
33  internal override IEnumerable<Cell> GetNext()
34  {
35  foreach (Cell cell in base.GetNext())
36  {
37  lastCell = cell;
38  yield return cell;
39  }
40  while (i-- > 0)
41  {
42  yield return null;
43  }
44  }
45  }
46 }
Abstract class for returning cells by walking through topology.
Definition: CellWalker.cs:8
Class wrapping a cell walker and applying limit to number of walked cells.
Class wrapping a cell walker and applying limit to number of walked cells but if wrapped cell walker ...