PEP8 formatting in map.tile
This commit is contained in:
parent
aacc5d56ca
commit
ac5efa7518
1 changed files with 19 additions and 16 deletions
|
@ -1,8 +1,6 @@
|
||||||
#!/usr/bin/env python3
|
from typing import Tuple
|
||||||
# Eryn Wells <eryn@erynwells.me>
|
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
from typing import Tuple
|
|
||||||
|
|
||||||
graphic_datatype = np.dtype([
|
graphic_datatype = np.dtype([
|
||||||
# Character, a Unicode codepoint represented as an int32
|
# Character, a Unicode codepoint represented as an int32
|
||||||
|
@ -15,31 +13,36 @@ graphic_datatype = np.dtype([
|
||||||
|
|
||||||
tile_datatype = np.dtype([
|
tile_datatype = np.dtype([
|
||||||
# Bool indicating whether this tile can be traversed
|
# Bool indicating whether this tile can be traversed
|
||||||
('walkable', np.bool),
|
('walkable', np.bool_),
|
||||||
# Bool indicating whether this tile is transparent
|
# Bool indicating whether this tile is transparent
|
||||||
('transparent', np.bool),
|
('transparent', np.bool_),
|
||||||
# A graphic struct (as above) defining the look of this tile when it's not visible
|
# A graphic struct (as above) defining the look of this tile when it's not visible
|
||||||
('dark', graphic_datatype),
|
('dark', graphic_datatype),
|
||||||
# A graphic struct (as above) defining the look of this tile when it's visible
|
# A graphic struct (as above) defining the look of this tile when it's visible
|
||||||
('light', graphic_datatype),
|
('light', graphic_datatype),
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
def tile(*,
|
def tile(*,
|
||||||
walkable: int,
|
walkable: int,
|
||||||
transparent: int,
|
transparent: int,
|
||||||
dark: Tuple[int, Tuple[int, int, int], Tuple[int, int ,int]],
|
dark: Tuple[int, Tuple[int, int, int], Tuple[int, int, int]],
|
||||||
light: Tuple[int, Tuple[int, int, int], Tuple[int, int ,int]]) -> np.ndarray:
|
light: Tuple[int, Tuple[int, int, int], Tuple[int, int, int]]) -> np.ndarray:
|
||||||
return np.array((walkable, transparent, dark, light), dtype=tile_datatype)
|
return np.array((walkable, transparent, dark, light), dtype=tile_datatype)
|
||||||
|
|
||||||
|
|
||||||
# An overlay color for tiles that are not visible and have not been explored
|
# An overlay color for tiles that are not visible and have not been explored
|
||||||
Shroud = np.array((ord(' '), (255, 255, 255), (0, 0, 0)), dtype=graphic_datatype)
|
Shroud = np.array((ord(' '), (255, 255, 255), (0, 0, 0)), dtype=graphic_datatype)
|
||||||
|
|
||||||
Empty = tile(walkable=False, transparent=False,
|
Empty = tile(
|
||||||
|
walkable=False, transparent=False,
|
||||||
dark=(ord(' '), (255, 255, 255), (0, 0, 0)),
|
dark=(ord(' '), (255, 255, 255), (0, 0, 0)),
|
||||||
light=(ord(' '), (255, 255, 255), (0, 0, 0)))
|
light=(ord(' '), (255, 255, 255), (0, 0, 0)))
|
||||||
Floor = tile(walkable=True, transparent=True,
|
Floor = tile(
|
||||||
|
walkable=True, transparent=True,
|
||||||
dark=(ord('·'), (80, 80, 100), (50, 50, 50)),
|
dark=(ord('·'), (80, 80, 100), (50, 50, 50)),
|
||||||
light=(ord('·'), (100, 100, 120), (80, 80, 100)))
|
light=(ord('·'), (100, 100, 120), (80, 80, 100)))
|
||||||
Wall = tile(walkable=False, transparent=False,
|
Wall = tile(
|
||||||
|
walkable=False, transparent=False,
|
||||||
dark=(ord(' '), (255, 255, 255), (0, 0, 150)),
|
dark=(ord(' '), (255, 255, 255), (0, 0, 150)),
|
||||||
light=(ord(' '), (255, 255, 255), (50, 50, 200)))
|
light=(ord(' '), (255, 255, 255), (50, 50, 200)))
|
Loading…
Add table
Add a link
Reference in a new issue