public void GetCells(ushort x, ushort y, int range, GetCellDelegate cellFunction) { if (cellFunction == null) { return; } ushort minX = (ushort)Math.Max(0, x - range); ushort maxX = (ushort)Math.Min(MaxCellID - 1, x + range); ushort minY = (ushort)Math.Max(0, y - range); ushort maxY = (ushort)Math.Min(MaxCellID - 1, y + range); for (ushort ox = minX; ox <= maxX; ++ox) { for (ushort oy = minY; oy <= maxY; ++oy) { cellFunction(GetCell(ox, oy)); } } }
public void GetCells(UInt16 X, UInt16 Y, int Range, GetCellDelegate CellFunction) { if (CellFunction == null) { return; } UInt16 MinX = (ushort)Math.Max(0, (int)(X - Range)); UInt16 MaxX = (ushort)Math.Min((int)(MAX_CELL_ID - 1), (int)(X + Range)); UInt16 MinY = (ushort)Math.Max(0, (int)(Y - Range)); UInt16 MaxY = (ushort)Math.Min((int)(MAX_CELL_ID - 1), (int)(Y + Range)); for (UInt16 Ox = MinX; Ox <= MaxX; ++Ox) { for (UInt16 Oy = MinY; Oy <= MaxY; ++Oy) { CellFunction(GetCell(Ox, Oy)); } } ; }
public CollectionCellDelegate(GetCellDelegate getCell) { this.getCell = getCell; }
public TableCellDelegate(GetCellDelegate getCell, GetHeightDelegate getHeight) { this.getCell = getCell; this.getHeight = getHeight; }
public void GetCells(UInt16 X, UInt16 Y, int Range, GetCellDelegate CellFunction) { if (CellFunction == null) return; UInt16 MinX = (ushort)Math.Max(0, (int)(X - Range)); UInt16 MaxX = (ushort)Math.Min((int)(MAX_CELL_ID - 1), (int)(X + Range)); UInt16 MinY = (ushort)Math.Max(0, (int)(Y - Range)); UInt16 MaxY = (ushort)Math.Min((int)(MAX_CELL_ID - 1), (int)(Y + Range)); for (UInt16 Ox = MinX; Ox <= MaxX; ++Ox) for (UInt16 Oy = MinY; Oy <= MaxY; ++Oy) CellFunction(GetCell(Ox, Oy)); ; }