Commit graph

12 commits

Author SHA1 Message Date
7428d95126 Fix the implementation of Point.is_adjacent_to 2023-02-18 22:51:58 -08:00
06d34a527b Add Point.manhattan_distance_to
Returns the manhattan distance to another Point.
2023-02-18 22:51:42 -08:00
462eebd95c Add Rect.corners
An iterator over the corners of the rectangle
2023-02-18 22:51:19 -08:00
633580e27a Add Rect.edges
Iterates the minimum and maximum x and y edges for the Rect.
2023-02-15 08:22:32 -08:00
36206b5cc0 Clean up __add__ on Point; add __sub__
The dunder add method only ever had one overload, so you don't need to
declare an overload
2023-02-12 19:44:28 -08:00
ec28f984da Add a couple geometry methods
- Vector.from_point to convert a point to a vector
- Rect.width and Rect.height convenience properties
2023-02-12 15:52:26 -08:00
cf31bcc272 Create a more semantic Size.numpy_shape property 2023-02-12 14:28:14 -08:00
727a0737c6 Use integer division for Rect.mid_y and Rect.mid_x 2023-02-10 21:13:49 -08:00
7b0b7ff5b6 Add Rect.intersects 2023-02-10 21:13:31 -08:00
391f84b21b Fix up the type annotations for geometry.Direction 2023-02-09 16:09:58 -08:00
9a04692539 Refactor map generator package
- Move room generators to map.generators.room
- Move corridor generators to map.generators.corridor

Generators have a generate() method that generates the things they place,
and an apply() method that applies their objects to a grid of tiles.
2023-02-09 16:07:29 -08:00
f6fe9d0f09 Move the roguebasin package to erynrl 2022-05-12 09:05:27 -07:00
Renamed from roguebasin/geometry.py (Browse further)