home *** CD-ROM | disk | FTP | other *** search
/ PC PowerPlay 56 / CDPowerplay56Disc2.iso / demos / blade / data1.cab / Program_Executable_Files / Lib / OnInitTake.pyc (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2000-10-27  |  1.7 KB  |  46 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 1.5)
  3.  
  4. InitTakeDictionary = { }
  5.  
  6. def AddOnInitTakeEvent(objname, funct, flag = 0):
  7.     InitTakeDictionary[objname] = [
  8.         funct,
  9.         flag]
  10.  
  11.  
  12. def DelOnInitTakeEvent(objname):
  13.     if InitTakeDictionary.has_key(objname):
  14.         del InitTakeDictionary[objname]
  15.     
  16.  
  17.  
  18. def OnInitTakeFunc(objname):
  19.     if InitTakeDictionary.has_key(objname):
  20.         InitTakeDictionary[objname][0]()
  21.         return InitTakeDictionary[objname][1]
  22.     
  23.  
  24.  
  25. def SaveData(filename):
  26.     import cPickle
  27.     funcfile = open(filename, 'wt')
  28.     p = cPickle.Pickler(funcfile)
  29.     d = (InitTakeDictionary,)
  30.     p.dump(d)
  31.     funcfile.close()
  32.  
  33.  
  34. def LoadData(filename):
  35.     global InitTakeDictionary
  36.     import cPickle
  37.     funcfile = open(filename, 'rt')
  38.     p = cPickle.Unpickler(funcfile)
  39.     d = p.load()
  40.     funcfile.close()
  41.     print d
  42.     InitTakeDictionary = d[0]
  43.  
  44. import GameState
  45. GameState.ModulesToBeSaved.append(__import__(__name__))
  46.