# /datum/cell_grid

## Vars | |

grid | 2d Cell Grid |
---|---|

## Procs | |

box_has_border | Retrieve directions (N,E,S,W) where box has truthy elements adjacent to it |

drawLBox | Draw 2 orthogonal boxes that connect (x1,y1) to (x2,y2) based on the internal size |

drawLShape | Draw 2 orthogonal lines that connect (x1,y1) to (x2,y2) |

draw_area | Draw in a region (box) from (min_x, min) to (max_x, max_y) |

draw_box | Retrieve list of (x,y) tuples composing line from (x1,y1) to (x2,y2) - Bresenham Line |

draw_from_string | Convert a string array to cell_grid assigning value_alive when 1 and value_dead when 0 |

draw_line | Draw line from (x1,y1) to (x2,y2) - Bresenham Line Drawing |

fill_points | Set of list of (x,y) tuples in cell grid |

find_contigious_cells | Retrieve a list of contigious open/set regions that contain the corresponding (x,y) tuple lists for those regions |

generate_maze | Generates maze with the botom left of (x1,y1) and top right of (x2,y2) where all open cells are set to the floor_value |

get_box_border | Get list of (x,y) tuples that make up edges of a box (x1,y1) to (x2,y2) |

get_cell_attribute | Retrieve an attribute of a cell when cell use associative arrays |

get_cell_neighbors | Retrieve list of list(x,y) tuples for coordinate provided |

get_distance | Get the (Chebyshev) distance between two points |

get_line | Retrieve list of (x,y) tuples composing line from (x1,y1) to (x2,y2) - Bresenham Line |

get_manhattan_distance | Get the Manhattan distance between two points |

has_empty_neighbor | Determine if cell has any empty/closed/falsey neighbors |

## Var Details

### grid

2d Cell Grid

## Proc Details

### box_has_border

Retrieve directions (N,E,S,W) where box has truthy elements adjacent to it

### drawLBox

Draw 2 orthogonal boxes that connect (x1,y1) to (x2,y2) based on the internal size

### drawLShape

Draw 2 orthogonal lines that connect (x1,y1) to (x2,y2)

### draw_area

Draw in a region (box) from (min_x, min) to (max_x, max_y)

### draw_box

Retrieve list of (x,y) tuples composing line from (x1,y1) to (x2,y2) - Bresenham Line

### draw_from_string

Convert a string array to cell_grid assigning value_alive when 1 and value_dead when 0

### draw_line

Draw line from (x1,y1) to (x2,y2) - Bresenham Line Drawing

### fill_points

Set of list of (x,y) tuples in cell grid

### find_contigious_cells

Retrieve a list of contigious open/set regions that contain the corresponding (x,y) tuple lists for those regions

### generate_maze

Generates maze with the botom left of (x1,y1) and top right of (x2,y2) where all open cells are set to the floor_value

### get_box_border

Get list of (x,y) tuples that make up edges of a box (x1,y1) to (x2,y2)

### get_cell_attribute

Retrieve an attribute of a cell when cell use associative arrays

### get_cell_neighbors

Retrieve list of list(x,y) tuples for coordinate provided

### get_distance

Get the (Chebyshev) distance between two points

### get_line

Retrieve list of (x,y) tuples composing line from (x1,y1) to (x2,y2) - Bresenham Line

### get_manhattan_distance

Get the Manhattan distance between two points

### has_empty_neighbor

Determine if cell has any empty/closed/falsey neighbors