diff --git a/app/src/main/java/com/example/fancywork/fancyLib/Difficulty.kt b/app/src/main/java/com/example/fancywork/fancyLib/Difficulty.kt new file mode 100644 index 0000000..5ecc0a3 --- /dev/null +++ b/app/src/main/java/com/example/fancywork/fancyLib/Difficulty.kt @@ -0,0 +1,5 @@ +package com.example.fancywork.fancyLib + +enum class Difficulty { + UNDEFINED, EASY, MEDIUM, HARD, EXTREMELY_HARD +} diff --git a/app/src/main/java/com/example/fancywork/fancyLib/FancyPicture.kt b/app/src/main/java/com/example/fancywork/fancyLib/FancyPicture.kt new file mode 100644 index 0000000..90e4e28 --- /dev/null +++ b/app/src/main/java/com/example/fancywork/fancyLib/FancyPicture.kt @@ -0,0 +1,36 @@ +package com.example.fancywork.fancyLib + +import android.graphics.Bitmap + +data class FancyPicture( + val id: String, + val title: String, + val image: Bitmap, + val colors: List> +) { + // todo id generator + // todo difficulty definer + + var author: String = "unknown" + var difficulty: Difficulty = Difficulty.UNDEFINED + + constructor( + id: String, + title: String, + image: Bitmap, + colors: List>, + author: String, + difficulty: Difficulty + ) : this(id, title, image, colors) { + this.author = author + this.difficulty = difficulty + } + + fun getProportions(): Pair? { + if (colors.isEmpty() || colors[0].isEmpty()) { + return null + } + + return Pair(colors.size, colors[0].size) + } +}