Add doc string for Configuration attributes

This commit is contained in:
Eryn Wells 2023-03-05 10:49:02 -08:00
parent e2553cca3b
commit c488ef9c2b
2 changed files with 20 additions and 9 deletions

View file

@ -39,18 +39,16 @@ def main(argv):
else:
font_config = FontConfiguration.default_configuration()
except FontConfigurationError as error:
log.ROOT.error('Unable to create a default font configuration: %s', error)
log.ROOT.error('Unable to create a font configuration: %s', error)
return -1
configuration = Configuration(
console_size=CONSOLE_SIZE,
console_font_config=font_config,
map_size=MAP_SIZE,
console_font_configuration=font_config,
sandbox=args.sandbox)
engine = Engine(configuration)
tileset = configuration.console_font_config.tileset
tileset = configuration.console_font_configuration.tileset
console = tcod.Console(*configuration.console_size.numpy_shape, order='F')
with tcod.context.new(columns=console.width, rows=console.height, tileset=tileset) as context:
engine.run_event_loop(context, console)

View file

@ -166,10 +166,23 @@ class TilesheetFontConfiguration(FontConfiguration):
@dataclass
class Configuration:
'''Configuration of the game engine'''
console_size: Size
console_font_config: FontConfiguration
'''
Configuration of the game engine
### Attributes
console_font_configuration : FontConfiguration
A configuration object that defines the font to use for rendering the console
console_size : Size
The size of the console in tiles
map_size : Size
The size of the map in tiles
sandbox : bool
If this flag is toggled on, the map is rendered with no shroud
'''
console_font_configuration: FontConfiguration
console_size: Size = CONSOLE_SIZE
map_size: Size = MAP_SIZE
sandbox: bool = False