home *** CD-ROM | disk | FTP | other *** search
/ PC PowerPlay 56 / CDPowerplay56Disc2.iso / demos / blade / data1.cab / Program_Executable_Files / Lib / ObjStore.py < prev    next >
Encoding:
Text File  |  2000-10-27  |  653 b   |  35 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6. ObjectsStore={}
  7.  
  8. StoreIndex=0 # Que no se me olvide guardar este valor al guardar partida
  9.  
  10.  
  11. def GetNewId():
  12.     global StoreIndex
  13.  
  14.     StoreIndex=StoreIndex+1
  15.     key=str(StoreIndex)
  16.     while ObjectsStore.has_key(key):
  17.         StoreIndex=StoreIndex+1
  18.         key=str(StoreIndex)
  19.  
  20. ##    print "GetNewId()",key
  21.     return key
  22.  
  23.  
  24. def CheckStore():
  25.     for i in ObjectsStore.keys():
  26.         try:
  27.             obj=ObjectsStore[i]
  28.             ret=obj.persistent_check()
  29.             if not ret:
  30.                 del ObjectsStore[i]
  31.         except AttributeError:
  32.             pass
  33.         except TypeError:
  34.             pass
  35.