From 62a29cf2e9dfbe646ef97bb10c4d196737108592 Mon Sep 17 00:00:00 2001 From: Kyle Benesch <4b796c65+github@gmail.com> Date: Wed, 12 Apr 2023 23:40:03 -0700 Subject: [PATCH] Fix deprecated np.bool dtype. I've already applied this fix to the sources, so this only needs to be updated on the site itself. --- content/tutorials/tcod/v2/part-2.md | 8 ++++---- content/tutorials/tcod/v2/part-4.md | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/content/tutorials/tcod/v2/part-2.md b/content/tutorials/tcod/v2/part-2.md index cd347e6e..d38caaea 100644 --- a/content/tutorials/tcod/v2/part-2.md +++ b/content/tutorials/tcod/v2/part-2.md @@ -417,8 +417,8 @@ graphic_dt = np.dtype( # Tile struct used for statically defined tile data. tile_dt = np.dtype( [ - ("walkable", np.bool), # True if this tile can be walked over. - ("transparent", np.bool), # True if this tile doesn't block FOV. + ("walkable", bool), # True if this tile can be walked over. + ("transparent", bool), # True if this tile doesn't block FOV. ("dark", graphic_dt), # Graphics for when this tile is not in FOV. ] ) @@ -467,8 +467,8 @@ We take this new data type and use it in the next bit: # Tile struct used for statically defined tile data. tile_dt = np.dtype( [ - ("walkable", np.bool), # True if this tile can be walked over. - ("transparent", np.bool), # True if this tile doesn't block FOV. + ("walkable", bool), # True if this tile can be walked over. + ("transparent", bool), # True if this tile doesn't block FOV. ("dark", graphic_dt), # Graphics for when this tile is not in FOV. ] ) diff --git a/content/tutorials/tcod/v2/part-4.md b/content/tutorials/tcod/v2/part-4.md index bf94f7e9..36a6b33d 100644 --- a/content/tutorials/tcod/v2/part-4.md +++ b/content/tutorials/tcod/v2/part-4.md @@ -57,8 +57,8 @@ For that, we'll want a new `graphic_dt` in the `tile_dt` type, called `light`. W {{< highlight diff >}} tile_dt = np.dtype( [ - ("walkable", np.bool), # True if this tile can be walked over. - ("transparent", np.bool), # True if this tile doesn't block FOV. + ("walkable", bool), # True if this tile can be walked over. + ("transparent", bool), # True if this tile doesn't block FOV. ("dark", graphic_dt), # Graphics for when this tile is not in FOV. + ("light", graphic_dt), # Graphics for when the tile is in FOV. ] @@ -99,8 +99,8 @@ wall = new_tile( {{< original-tab >}}
tile_dt = np.dtype(
[
- ("walkable", np.bool), # True if this tile can be walked over.
- ("transparent", np.bool), # True if this tile doesn't block FOV.
+ ("walkable", bool), # True if this tile can be walked over.
+ ("transparent", bool), # True if this tile doesn't block FOV.
("dark", graphic_dt), # Graphics for when this tile is not in FOV.
("light", graphic_dt), # Graphics for when the tile is in FOV.
]
@@ -144,8 +144,8 @@ Let's go through the new additions.
```py3
tile_dt = np.dtype(
[
- ("walkable", np.bool), # True if this tile can be walked over.
- ("transparent", np.bool), # True if this tile doesn't block FOV.
+ ("walkable", bool), # True if this tile can be walked over.
+ ("transparent", bool), # True if this tile doesn't block FOV.
("dark", graphic_dt), # Graphics for when this tile is not in FOV.
("light", graphic_dt), # Graphics for when the tile is in FOV.
]