chessai.ui.null

 1import typing
 2
 3import chessai.core.board
 4import chessai.core.gamestate
 5import chessai.core.ui
 6
 7class NullUI(chessai.core.ui.UI):
 8    """
 9    A UI that renders nothing.
10    This is useful when are more interested in the output of the game
11    (e.g., the log or gif) than seeing the actual game.
12    """
13
14    def draw(self, state: chessai.core.gamestate.GameState, **kwargs: typing.Any) -> None:
15        pass
class NullUI(chessai.core.ui.UI):
 8class NullUI(chessai.core.ui.UI):
 9    """
10    A UI that renders nothing.
11    This is useful when are more interested in the output of the game
12    (e.g., the log or gif) than seeing the actual game.
13    """
14
15    def draw(self, state: chessai.core.gamestate.GameState, **kwargs: typing.Any) -> None:
16        pass

A UI that renders nothing. This is useful when are more interested in the output of the game (e.g., the log or gif) than seeing the actual game.

def draw(self, state: chessai.core.gamestate.GameState, **kwargs: Any) -> None:
15    def draw(self, state: chessai.core.gamestate.GameState, **kwargs: typing.Any) -> None:
16        pass

Visualize the state of the game to the UI. This is the typically the main override point for children. Note that how this method visualizes the game completely unrelated to how the draw_image() method works. draw() will render to whatever the specific UI for the child class is, while draw_image() specifically creates an image which will be used for animations. If the child UI is also image-based than it can leverage draw_image(), but there is no requirement to do that.