Module pacai.ui.pacman.view

Expand source code
from pacai.ui.view import AbstractView
from pacai.ui.pacman.frame import PacmanFrame

class PacmanAbstractView(AbstractView):
    """
    A abstract view for pacman.
    Knows how to create pacman frames.
    """

    def __init__(self, **kwargs):
        super().__init__(**kwargs)

    # Override
    def _createFrame(self, state):
        return PacmanFrame(self._frameCount, state, self._turnCount)

Classes

class PacmanAbstractView (**kwargs)

A abstract view for pacman. Knows how to create pacman frames.

Expand source code
class PacmanAbstractView(AbstractView):
    """
    A abstract view for pacman.
    Knows how to create pacman frames.
    """

    def __init__(self, **kwargs):
        super().__init__(**kwargs)

    # Override
    def _createFrame(self, state):
        return PacmanFrame(self._frameCount, state, self._turnCount)

Ancestors

Subclasses

Methods

def finish(self)

Inherited from: AbstractView.finish

Signal that the game is over and the UI should cleanup.

def getKeyboard(self)

Inherited from: AbstractView.getKeyboard

For views that support keyboards, get an instance of a pacai.ui.keyboard.Keyboard.

def initialize(self, state)

Inherited from: AbstractView.initialize

Perform an initial drawing of the view.

def update(self, state, forceDraw=False)

Inherited from: AbstractView.update

Materialize the view, given a state.