コード例 #1
0
 def getPlayerByIndex(self, index):
     # dep: this uses a cache so that all references to a certain player
     # index will always yield the same object, which is useful because you
     # can then test them for object equality
     valid = host.pmgr_isIndexValid(index)
     if not valid:
         if self._pcache.has_key(index):
             print "Removed player index %d from player cache" % index
             del self._pcache[index]
         return None
     if not self._pcache.has_key(index):
         self._pcache[index] = Player(index)
     return self._pcache[index]
コード例 #2
0
	def getPlayerByIndex(self, index):
		# dep: this uses a cache so that all references to a certain player
		# index will always yield the same object, which is useful because you
		# can then test them for object equality
		valid = host.pmgr_isIndexValid(index)
		if not valid: 
			if self._pcache.has_key(index):
				if g_debug: print "Removed player index %d from player cache" % index
				del self._pcache[index]
			return None
		if not self._pcache.has_key(index):
			self._pcache[index] = Player(index)
		return self._pcache[index]
コード例 #3
0
 def isValid(self):
     return host.pmgr_isIndexValid(self.index)
コード例 #4
0
	def isValid(self): return host.pmgr_isIndexValid(self.index)
	def isRemote(self): return host.pmgr_p_get("remote", self.index)
コード例 #5
0
	def isValid(self): return host.pmgr_isIndexValid(self.index)
	def isRemote(self): return host.pmgr_p_get("remote", self.index)