def _showVehicle(self, vehicleID, location):
     entry = self._entries.get(vehicleID, None)
     if entry is not None and entry.isAlive():
         matrix = matrix_factory.makeVehicleMPByLocation(
             vehicleID, location, self._arenaVisitor.getArenaPositions())
         if matrix is not None:
             self.__setLocationAndMatrix(entry, location, matrix)
             self._setInAoI(entry, True)
             self.__setActive(entry, True)
Example #2
0
 def __addEntryToPool(self, vehicleID, location = VEHICLE_LOCATION.UNDEFINED, positions = None):
     if location != VEHICLE_LOCATION.UNDEFINED:
         matrix = matrix_factory.makeVehicleMPByLocation(vehicleID, location, positions or {})
         if matrix is None:
             location = VEHICLE_LOCATION.UNDEFINED
     else:
         matrix, location = matrix_factory.getVehicleMPAndLocation(vehicleID, positions or {})
     active = location != VEHICLE_LOCATION.UNDEFINED
     model = self._addEntryEx(vehicleID, _S_NAME.VEHICLE, _C_NAME.ALIVE_VEHICLES, matrix=matrix, active=active)
     if model is not None:
         model.setLocation(location)
     return model
Example #3
0
 def __addEntryToPool(self, vehicleID, location = VEHICLE_LOCATION.UNDEFINED, positions = None):
     if location != VEHICLE_LOCATION.UNDEFINED:
         matrix = matrix_factory.makeVehicleMPByLocation(vehicleID, location, positions or {})
         if matrix is None:
             location = VEHICLE_LOCATION.UNDEFINED
     else:
         matrix, location = matrix_factory.getVehicleMPAndLocation(vehicleID, positions or {})
     active = location != VEHICLE_LOCATION.UNDEFINED
     model = self._addEntryEx(vehicleID, _S_NAME.VEHICLE, _C_NAME.ALIVE_VEHICLES, matrix=matrix, active=active)
     if model is not None:
         model.setLocation(location)
     return model
Example #4
0
 def __onMinimapVehicleRemoved(self, vehicleID):
     if vehicleID == self.__playerVehicleID or vehicleID not in self._entries:
         return
     entry = self._entries[vehicleID]
     if entry.getLocation() == VEHICLE_LOCATION.AOI:
         if not minimap_utils.isVehicleInAOI(entry.getMatrix()):
             matrix = matrix_factory.makeVehicleMPByLocation(vehicleID, VEHICLE_LOCATION.AOI_TO_FAR, {})
             self.__setLocationAndMatrix(entry, VEHICLE_LOCATION.AOI_TO_FAR, matrix)
             self.__setAoIToFarCallback(vehicleID)
         else:
             self.__hideVehicle(entry)
             self._notifyVehicleRemoved(vehicleID)
     else:
         LOG_DEBUG('Location of vehicle entry is not in AoI', entry)
Example #5
0
 def __onMinimapVehicleRemoved(self, vehicleID):
     if vehicleID == self.__playerVehicleID or vehicleID not in self._entries:
         return
     entry = self._entries[vehicleID]
     if entry.getLocation() == VEHICLE_LOCATION.AOI:
         if not minimap_utils.isVehicleInAOI(entry.getMatrix()):
             matrix = matrix_factory.makeVehicleMPByLocation(vehicleID, VEHICLE_LOCATION.AOI_TO_FAR, {})
             self.__setLocationAndMatrix(entry, VEHICLE_LOCATION.AOI_TO_FAR, matrix)
             self.__setAoIToFarCallback(vehicleID)
         else:
             self.__hideVehicle(entry)
             self._notifyVehicleRemoved(vehicleID)
     else:
         LOG_DEBUG('Location of vehicle entry is not in AoI', entry)
Example #6
0
 def __showVehicle(self, vehicleID, location):
     matrix = matrix_factory.makeVehicleMPByLocation(vehicleID, location, self._arenaVisitor.getArenaPositions())
     entry = self._entries[vehicleID]
     if matrix is None:
         self.__setActive(entry, False)
         return
     else:
         self.__setLocationAndMatrix(entry, location, matrix)
         self.__setInAoI(entry, True)
         self.__setActive(entry, True)
         if not self.__isObserver:
             animation = entry.getSpottedAnimation(self._entries.itervalues())
             if animation:
                 self.__playSpottedSound(entry)
                 self._invoke(entry.getID(), 'setAnimation', animation)
         return
Example #7
0
 def __showVehicle(self, vehicleID, location):
     matrix = matrix_factory.makeVehicleMPByLocation(
         vehicleID, location, self._arenaVisitor.getArenaPositions())
     entry = self._entries[vehicleID]
     if matrix is None:
         self.__setActive(entry, False)
         return
     else:
         self.__setLocationAndMatrix(entry, location, matrix)
         self.__setInAoI(entry, True)
         self.__setActive(entry, True)
         if not self.__isObserver:
             animation = entry.getSpottedAnimation(
                 self._entries.itervalues())
             if animation:
                 self.__playSpottedSound(entry)
                 self._invoke(entry.getID(), 'setAnimation', animation)
         return
Example #8
0
 def __showVehicle(self, vehicleID, location):
     matrix = matrix_factory.makeVehicleMPByLocation(vehicleID, location, self._arenaVisitor.getArenaPositions())
     entry = self._entries[vehicleID]
     if matrix is None:
         self.__setActive(entry, False)
         return
     else:
         if self.__isSPG:
             isSpotted = entry.getLocation() == VEHICLE_LOCATION.UNDEFINED
         else:
             isSpotted = True
         self.__setLocationAndMatrix(entry, location, matrix)
         self.__setInAoI(entry, True)
         self.__setActive(entry, True)
         animation = self.__getSpottedAnimation(entry, isSpotted)
         if animation and self.__replayRegistrator.validateShowVehicle(vehicleID):
             self.__playSpottedSound(entry)
             self._invoke(entry.getID(), 'setAnimation', animation)
             self.__replayRegistrator.registerShowVehicle(vehicleID)
         return