-import pygame\r
-import copy\r
-import pickle\r
-\r
-from pygame.event import Event\r
-\r
-class PickleableEvent(object):\r
- "A pygame.Event that can be serialized."\r
- \r
- def __init__(self,type,dict):\r
- self.__dict__ = copy.copy(dict)\r
- self.type = type\r
- self.event = Event(self.type,dict)\r
-\r
- def __getstate__(self):\r
- d = []\r
- d.append(self.type)\r
- d.append(copy.copy(self.event.dict))\r
- return d\r
-\r
- def __setstate__(self, d):\r
- self.__dict__ = copy.copy(d[1])\r
- self.type = d[0]\r
- self.event = Event(d[0],d[1])
\ No newline at end of file