5 import pygame.event as pge
6 import pygame.locals as pgl
9 class NajaEvent(object):
14 def post(cls, **attributes):
15 event = pge.Event(pgl.USEREVENT, naja_event_type=cls.TYPE,
21 return ev.type == pgl.USEREVENT and ev.naja_event_type == cls.TYPE
24 class SceneChangeEvent(NajaEvent):
28 def post(cls, scene_cls):
29 super(SceneChangeEvent, cls).post(scene_cls=scene_cls)
32 class QuitGameEvent(NajaEvent):
36 class InvalidateTheWorld(NajaEvent):
37 # This is used to signal to all the widgets that the world has changed
38 # and cached state may need to be recreated
42 class SelectEvent(NajaEvent):