Use the new map generator mechanism to generate rooms via cellular
atomata. Create a new CellularAtomatonRoomMethod class that uses
the Cellular Atomton class to create a room. Add a FreefromRoom class
that draws a room based on an ndarray of tiles.
Along the way I discovered I have misunderstood how numpy arrays
organize rows and columns. The numpy array creation routines take an
'order' argument that specifies whether arrays should be in C order (row
major) or Fortran order (column major). Fortran order lets you index
arrays with a more natural [x, y] coordinate order, and that's what the
tutorials I've read have shown. So I've been using that. When I was
developing the Cellular Atomaton, I wrote some code that assumed row-
major order. I think I want to move everything to row-major / C-style,
but that will take a bit more time.
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.
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.
- 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
Add a highlight grid to Map, with locations set to True if that point should be
drawn with a "highlight" treatment.
Add the highlight graphic_dtype to all Tiles.
This configuration object can actually apply to all room generators.
Notably: copy the default configuration object before setting it to self.configuration.
- Generate creates rooms and corridors, and apply applies them to a tile grid.
- Add up and down stairs generation to the Room Generators.
- Clean up Room.wall_points and Room.floor_points to make it easier to
write a generic apply() method on RoomGenerator
- 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.