Events start in the Interface. The interface gets first crack at any incoming
events. If the interface doesn't handle the event, it is given to the
engine. The engine has an EngineEventHandler that yields actions just
like the event handler prior to this change.
The interface's event handler passes events to each window in the
interface. Windows can choose to handle events however they like, and
they return a bool indicating whether the event was fully handled.
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.
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
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.
- 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.
It renders a bar of a certain width and a percentage full. Use it to render HP.
Add a new Python package called interface. The Bar class lives there. Also add a
bunch of color defintions to a module called interface.color.