Document map.grid
This commit is contained in:
parent
84e51a17ff
commit
4b09d467d1
1 changed files with 7 additions and 2 deletions
|
@ -1,10 +1,15 @@
|
|||
# Eryn Wells <eryn@erynwells.me>
|
||||
|
||||
'''
|
||||
Utilities for maps.
|
||||
'''
|
||||
|
||||
import numpy as np
|
||||
|
||||
from .tile import Empty
|
||||
from ..geometry import Size
|
||||
|
||||
|
||||
def make_grid(size: Size):
|
||||
return np.full(size.numpy_shape, fill_value=Empty, order='F')
|
||||
def make_grid(size: Size, fill: np.ndarray = Empty) -> np.ndarray:
|
||||
'''Make a numpy array of the given size filled with `fill` tiles.'''
|
||||
return np.full(size.numpy_shape, fill_value=fill, order='F')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue