Document map.grid

This commit is contained in:
Eryn Wells 2023-03-05 13:36:04 -08:00
parent 84e51a17ff
commit 4b09d467d1

View file

@ -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')