protected override void EndLastItem(GridGeneratorBase mono, int x, int y) { if (x * y != (Width - 1) * (Height - 1)) { return; } base.EndLastItem(mono, x, y); }
protected override void EndLastItem(GridGeneratorBase mono, int x, int y) { if (_visitedCellCtr < Height * Width - 1) { return; } base.EndLastItem(mono, x, y); }
public override void Execute(GridGeneratorBase mono) { mono.StartCoroutine(WalkThroughCellsCoRoutine((x, y) => { if (Cells[x][y].IsVisited) { return; } Cells[x][y].IsVisited = true; EndLastItem(mono, x, y); })); }
public override void Execute(GridGeneratorBase mono) { mono.StartCoroutine(WalkThroughCellsCoRoutine((x, y) => { if (x == -1) { EndLastItem(mono, x, y); } else if (!Cells[x][y].IsVisited) { Cells[x][y].IsVisited = true; } })); }
public override void Execute(GridGeneratorBase mono) { int currentY = 0; var sideWinderGroup = new List <int>(); mono.StartCoroutine(WalkThroughCellsCoRoutine((x, y) => { int wallToDelete; if (IsTopCell(y)) { wallToDelete = Constants.RIGHT; } else { if (y == currentY) { sideWinderGroup.Add(x); } else { currentY = y; sideWinderGroup.Clear(); sideWinderGroup.Add(x); } bool goUp = IsRightMostCell(x) || Utils.Percentage(50); if (goUp) { x = Utils.RandomSelectionFromArray(sideWinderGroup.ToArray()); wallToDelete = Constants.TOP; sideWinderGroup.Clear(); } else { wallToDelete = Constants.RIGHT; } } Cells[x][y].DeleteWallWithPosition(wallToDelete); EndLastItem(mono, x, y); })); }
public override void Execute(GridGeneratorBase mono) { mono.StartCoroutine(WalkThroughCellsCoRoutine((x, y) => { int wallToDelete; if (IsTopCell(y)) { wallToDelete = Constants.RIGHT; } else if (IsRightMostCell(x)) { wallToDelete = Constants.TOP; } else { wallToDelete = Utils.Percentage(50) ? Constants.TOP : Constants.RIGHT; } Cells[x][y].DeleteWallWithPosition(wallToDelete); EndLastItem(mono, x, y); })); }
/// <summary> /// RecursiveBacktracker does not call this /// it completely overrides something it doesn't want /// from RandomWalkAlgo /// </summary> protected virtual void EndLastItem(GridGeneratorBase mono, int x, int y) { mono.EndCoroutine(); }
public abstract void Execute(GridGeneratorBase gridGeneratorBase);
public abstract override void Execute(GridGeneratorBase mono);
protected override void EndLastItem(GridGeneratorBase mono, int x, int y) { mono.EndCoroutine(); }