320ff8006b312abe49f96fe7af021472f9e82605
[tabakrolletjie.git] / tabakrolletjie / scenes / base.py
1 """ Base scene class. """
2
3 from pygame.sprite import RenderUpdates
4 from ..cursor import Cursor
5
6
7 class BaseScene(object):
8     def __init__(self):
9         self._cursor = Cursor()
10         self._cursor_group = RenderUpdates()
11
12     def _set_cursor(self, name):
13         self._cursor.activate(name, self._cursor_group)
14
15     def _unset_cursor(self):
16         self._cursor.deactivate(self._cursor_group)
17
18     def _draw_cursor(self, surface):
19         """Draw the cursor. Should be called at the end of the render
20            method by scenes that need it."""
21         self._cursor_group.update()
22         self._cursor_group.draw(surface)
23
24     def enter(self, gamestate):
25         """ Enter the scene. """
26
27     def exit(self, gamestate):
28         """ Leave the scene. """
29
30     def event(self, ev, gamestate):
31         """ Handle an event. """
32
33     def render(self, screen, gamestate):
34         """ Render the scene. """
35
36     def tick(self, gamestate):
37         """ Update the world based on time """