going-rogue/erynrl/map/grid.py

16 lines
342 B
Python
Raw Normal View History

# Eryn Wells <eryn@erynwells.me>
2023-03-05 13:36:04 -08:00
'''
Utilities for maps.
'''
import numpy as np
from .tile import Empty
from ..geometry import Size
2023-03-05 13:36:04 -08:00
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')