A RoomGenerator is now made up of two "method" classes that do separate
things:
1. A RectMethod takes the size of the area to generate and creates an
iterable stream of Rects to fill that area.
2. A RoomMethod takes a Rect and creates a room inside of it.
These two components are composable in interesting ways, and allow a
more data-driven approach to map generation, though I don't yet have the
ability to make this mechansim entirely data-driven.
There was a bug in how MapWindow was calculating the numpy array slices
when drawing the map. Redo how this works so that MapWindow can draw
maps of arbitrary size and center maps that are smaller than the window's
drawable area.
- Add Point.numpy_index to simplify converting Points to indexes
- Update the doc string of Point.direction_to_adjacent_point
- Add a Rect.__contains__ implementation for another Rect
- Refactor the contains implementations above into helper methods
First pass at a cellular atomata map generator.
Add map.grid and a make_grid function to make it easier to make
numpy arrays for Map purposes.
Add ca.py to test the generator.
The base class Actor doesn't declare a (optional) actor attribute.
The ActionWithActor has a non-optional actor attribute.
This makes the type checker happier, and means we can have some actions
that don't have actors.
- Move all map rendering to a new MapWindow class
- Clip map rendering to the bounds of the Window
- Pass in Entities list from the Engine and render them relative to the window
The map doesn't scroll yet, so it'll always be clipped on the bottom and
right.
- Allow passing a font on the command line via --font
- Move the engine configuration to its own module
- Redo entirely the font configuration: move it to the configuration module
- Pass the configuration object to the Map in place of the size argument