def _setupPlugins(self, skipConfirm): shellsPrice = self.getShellsLayoutPrice() eqsPrice = self.getEqsLayoutPrice() isWalletValidatorEnabled = bool(shellsPrice.gold or eqsPrice.gold) self.addPlugins( (proc_plugs.VehicleLockValidator(self.vehicle), proc_plugs.WalletValidator(isWalletValidatorEnabled), proc_plugs.VehicleLayoutValidator(shellsPrice, eqsPrice)))
def __init__(self, vehicle, shellsLayout = None, eqsLayout = None): """ Ctor. @param vehicle: vehicle @param shellsLayout: shells @param eqsLayout: equipments """ super(VehicleLayoutProcessor, self).__init__() self.vehicle = vehicle self.shellsLayout = shellsLayout or [] self.eqsLayout = eqsLayout or [] shellsPrice = self.getShellsLayoutPrice() eqsPrice = self.getEqsLayoutPrice() isWalletValidatorEnabled = bool(shellsPrice[1] or eqsPrice[1]) self.addPlugins((plugins.WalletValidator(isWalletValidatorEnabled), plugins.VehicleLayoutValidator(shellsPrice, eqsPrice)))