Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle cabbage/radish and water/milk
closes #49
- Loading branch information
1 parent
0f436f8
commit 51fd8b4
Showing
8 changed files
with
56 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
bunnies/src/main/java/com/fueledbycaffeine/bunnypedia/database/model/FeedTheBunny.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.fueledbycaffeine.bunnypedia.database.model | ||
|
||
import android.os.Parcelable | ||
import kotlinx.android.parcel.Parcelize | ||
|
||
@Parcelize | ||
data class FeedTheBunny( | ||
val cabbage: Int, | ||
val radish: Int, | ||
val water: Int, | ||
val milk: Int | ||
): Parcelable { | ||
val applicable get() = cabbage != 0 || radish != 0 || water != 0 || milk != 0 | ||
|
||
val cabbageAndWater get() = cabbage > 0 && water > 0 | ||
val radishAndMilk get() = radish > 0 && milk > 0 | ||
val cabbageOrRadish get() = cabbage > 0 && radish > 0 | ||
val waterOrMilk get() = water > 0 && milk > 0 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters