Text Helper Classes and Functions

You can use classes and functions in this module to build a CLI interface for your game. These classes are used by default when constructing your game object with turnable.build_game().

class turnable.helpers.text.TextInputStream(stdout=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'>)

Input stream for CLI gameplay.

Performs input() calls for user input.

request(request: turnable.streams.CommandRequest) turnable.streams.CommandResponse

Handles CommandRequest and builds an appropiate CommandResponse.

class turnable.helpers.text.TextOutputStream(*args, clear: bool = True, **kwargs)

Output stream for CLI gameplay.

send(game: turnable.game.Game)

Handles how the information gets to the player.

turnable.helpers.text.clear_terminal()

Sends a system call to clear the terminal.