Exemple #1
0
 def _on_submit(amount: int, outcome: CommonChoiceOutcome):
     if outcome == CommonChoiceOutcome.ERROR:
         self.run(sim_info, on_completed=on_completed)
         return
     elif CommonChoiceOutcome.is_error_or_cancel(outcome):
         on_completed(False)
         return
     CommonHouseholdUtils.get_household(sim_info).funds.add(amount, Consts_pb2.FUNDS_MONEY_CHEAT)
     on_completed(True)
     return True
Exemple #2
0
 def _on_submit(amount: int, outcome: CommonChoiceOutcome):
     if outcome == CommonChoiceOutcome.ERROR:
         self.run(sim_info, on_completed=on_completed)
         return
     elif CommonChoiceOutcome.is_error_or_cancel(outcome):
         on_completed(False)
         return
     CommonHouseholdUtils.get_household(sim_info).funds.try_remove(
         amount,
         Consts_pb2.FUNDS_MONEY_CHEAT,
         sim=CommonSimUtils.get_sim_instance(sim_info),
         require_full_amount=False)
     on_completed(True)
     return True