private void PlaceBoxs() { int[] maxs = new int[] { 0, 0, 0, 0 }; ICell[] dropCells = new ICell[4]; foreach (ICell cell in DijkstraCells.Keys) { int dijkstraIndex = DijkstraCells[cell]; int i = -1; if (cell.X <= mapCenter.X && cell.Y <= mapCenter.Y && dijkstraIndex > maxs[0]) { i = 0; } else if (cell.X > mapCenter.X && cell.Y <= mapCenter.Y && dijkstraIndex > maxs[1]) { i = 1; } else if (cell.X <= mapCenter.X && cell.Y > mapCenter.Y && dijkstraIndex > maxs[2]) { i = 2; } else if (cell.X > mapCenter.X && cell.Y > mapCenter.Y && dijkstraIndex > maxs[3]) { i = 3; } if (i != -1) { maxs[i] = dijkstraIndex; dropCells[i] = cell; } } int j = 0; foreach (ICell cell in dropCells) { Box box = new Box(cell.X, cell.Y, (j + 2) % 4); _map.AddBox(box); DropPad pad = new DropPad(cell.X, cell.Y, j); ((InvertedMap)_map).AddDropPad(pad); j++; } }
public void AddDropPad(DropPad pad) { DropPads.Add(pad); }