Example #1
0
        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));
                }
            }
        }
Example #2
0
        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));
                }
            }
            ;
        }
Example #3
0
 public CollectionCellDelegate(GetCellDelegate getCell)
 {
     this.getCell = getCell;
 }
Example #4
0
 public TableCellDelegate(GetCellDelegate getCell, GetHeightDelegate getHeight)
 {
     this.getCell   = getCell;
     this.getHeight = getHeight;
 }
Example #5
0
        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)); ;
        }