Exemplo n.º 1
0
        public CollisionGrid CreateGrid(int[] data, int columns, int rows, int cellWidth, int cellHeight)
        {
            if (_grid != null)
                throw new InvalidOperationException("Only one collision grid can be created per world");

            _grid = new CollisionGrid(data, columns, rows, cellWidth, cellHeight);
            return _grid;
        }
 public CollisionGridCell(CollisionGrid parentGrid, int column, int row, int data)
 {
     _parentGrid = parentGrid;
     Column      = column;
     Row         = row;
     Data        = data;
     Flag        = data == 0 ? CollisionGridCellFlag.Empty : CollisionGridCellFlag.Solid;
 }
 public CollisionGridCell(CollisionGrid parentGrid, int column, int row, int data)
 {
     _parentGrid = parentGrid;
     Column = column;
     Row = row;
     Data = data;
     Flag = data == 0 ? CollisionGridCellFlag.Empty : CollisionGridCellFlag.Solid;
 }
Exemplo n.º 4
0
        public CollisionGrid CreateGrid(int[] data, int columns, int rows, int cellWidth, int cellHeight)
        {
            if (_grid != null)
            {
                throw new InvalidOperationException("Only one collision grid can be created per world");
            }

            _grid = new CollisionGrid(data, columns, rows, cellWidth, cellHeight);
            return(_grid);
        }