From af20aa2832c2c968e9df6716812432ad19a3eb10 Mon Sep 17 00:00:00 2001 From: Lucas Delanier Date: Sat, 8 Apr 2023 22:01:10 +0200 Subject: [PATCH] correct bugs --- .../com/example/shakecraft/viewmodel/MainViewModel.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ShakeAndCraft/app/src/main/java/com/example/shakecraft/viewmodel/MainViewModel.kt b/ShakeAndCraft/app/src/main/java/com/example/shakecraft/viewmodel/MainViewModel.kt index 16eecbc..1a4ec1d 100644 --- a/ShakeAndCraft/app/src/main/java/com/example/shakecraft/viewmodel/MainViewModel.kt +++ b/ShakeAndCraft/app/src/main/java/com/example/shakecraft/viewmodel/MainViewModel.kt @@ -17,23 +17,23 @@ class MainViewModel : ViewModel() { fun craft(recipe : Recipe, count : Int = 1){ currentPlayer.value?.craft(recipe, count) - currentPlayer.value = currentPlayer.value + this.currentPlayer.value = currentPlayer.value } fun addItem(item: Item) { currentPlayer.value?.addItem(item) - currentPlayer.value = currentPlayer.value + this.currentPlayer.value = currentPlayer.value } fun gainXp(xpReward: Int) { currentPlayer.value?.gainXp(xpReward) - currentPlayer.value = currentPlayer.value + this.currentPlayer.value = currentPlayer.value } fun equipeItem(item: Item): Boolean { currentPlayer.value?.equipeItem(item) - currentPlayer.value = currentPlayer.value + this.currentPlayer.value = currentPlayer.value return true } } \ No newline at end of file