using System.Collections.Generic;
public static void Main()
public Propagator Propagator;
public Level(int x, int y, int z)
for (int i = 0; i < x; i++)
for (int j = 0; j < y; j++)
Data[i][j] = new Slot[z];
for (int k = 0; k < z; k++)
Data[i][j][k] = new Slot();
for (int i = 0; i < x; i++)
for (int j = 0; j < y; j++)
for (int k = 0; k < z; k++)
Data[i][j][k].SlotLeft = Data[i][j][k];
public HashSet<Tile> Domain;
public HashSet<Tile> BorderLeft;
public HashSet<Tile> BorderRight;
public HashSet<Tile> BorderForward;
public HashSet<Tile> BorderBack;
public HashSet<Tile> BorderUp;
public HashSet<Tile> BorderDown;
public void RecomputeDomain()
public void Observe(HashSet<Slot> jobList)
HashSet<Slot> resultSet = new HashSet<Slot>();
int countLeft = BorderLeft.Count;
int countRight = BorderRight.Count;
int countForward = BorderForward.Count;
int countBack = BorderBack.Count;
BorderLeft.IntersectWith(SlotLeft.BorderRight);
BorderRight.IntersectWith(SlotRight.BorderLeft);
BorderForward.IntersectWith(SlotForward.BorderBack);
BorderBack.IntersectWith(SlotBack.BorderForward);
BorderUp.IntersectWith(SlotUp.BorderDown);
BorderDown.IntersectWith(SlotDown.BorderUp);
if (countLeft != BorderLeft.Count)
HashSet<Tile> AllowedLeft = new HashSet<Tile>();
HashSet<Tile> AllowedRight = new HashSet<Tile>();
HashSet<Tile> AllowedForward = new HashSet<Tile>();
HashSet<Tile> AllowedBack = new HashSet<Tile>();
HashSet<Tile> AllowedUp = new HashSet<Tile>();
HashSet<Tile> AllowedDown = new HashSet<Tile>();