def _buildData(self, candidates): isPlayerSpeaking = self.bwProto.voipController.isPlayerSpeaking userGetter = storage_getter('users')().getUser colorGetter = g_settings.getColorScheme('rosters').getColors mapping = [ (pInfo, userGetter(pInfo.dbID)) for pInfo in candidates.itervalues() ] sortedList = sorted(mapping, cmp=getUnitCandidatesComparator()) for pInfo, user in sortedList: dbID = pInfo.dbID self._mapping[dbID] = len(self._list) self._list.append(self._makePlayerVO(pInfo, user, colorGetter, isPlayerSpeaking(dbID)))
def _buildData(self, candidates): isPlayerSpeaking = self.bwProto.voipController.isPlayerSpeaking userGetter = storage_getter('users')().getUser colorGetter = g_settings.getColorScheme('rosters').getColors mapping = map(lambda pInfo: (pInfo, userGetter(pInfo.dbID)), candidates.itervalues()) sortedList = sorted(mapping, cmp=getUnitCandidatesComparator()) for pInfo, user in sortedList: dbID = pInfo.dbID self._mapping[dbID] = len(self._list) self._list.append(self._makePlayerVO(pInfo, user, colorGetter, isPlayerSpeaking(dbID)))
def _buildData(self, candidates): if self.app is not None: isPlayerSpeaking = self.app.voiceChatManager.isPlayerSpeaking else: isPlayerSpeaking = lambda dbID: False userGetter = storage_getter('users')().getUser colorGetter = g_settings.getColorScheme('rosters').getColors mapping = map(lambda pInfo: (pInfo, userGetter(pInfo.dbID)), candidates.itervalues()) sortedList = sorted(mapping, cmp=getUnitCandidatesComparator()) for (pInfo, user,) in sortedList: dbID = pInfo.dbID self._mapping[dbID] = len(self._list) self._list.append(self._makePlayerVO(pInfo, user, colorGetter, isPlayerSpeaking(dbID)))
def _buildData(self, candidates): if self.app is not None: isPlayerSpeaking = self.app.voiceChatManager.isPlayerSpeaking else: isPlayerSpeaking = lambda dbID: False userGetter = storage_getter('users')().getUser colorGetter = g_settings.getColorScheme('rosters').getColors mapping = map(lambda pInfo: (pInfo, userGetter(pInfo.dbID)), candidates.itervalues()) sortedList = sorted(mapping, cmp=getUnitCandidatesComparator()) for pInfo, user in sortedList: dbID = pInfo.dbID self._mapping[dbID] = len(self._list) self._list.append( self._makePlayerVO(pInfo, user, colorGetter, isPlayerSpeaking(dbID)))