-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fa9e6b5
commit 94ce0a1
Showing
15 changed files
with
277 additions
and
186 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
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
124 changes: 62 additions & 62 deletions
124
app/src/main/java/uz/gita/memorygame/data/ImagesMapper.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 |
---|---|---|
@@ -1,62 +1,62 @@ | ||
package uz.gita.memorygame.data | ||
|
||
import uz.gita.memorygame.R | ||
|
||
object ImagesMapper { | ||
val map = mapOf( | ||
0 to R.drawable.image_1, | ||
1 to R.drawable.image_2, | ||
2 to R.drawable.image_3, | ||
3 to R.drawable.image_4, | ||
4 to R.drawable.image_5, | ||
5 to R.drawable.image_6, | ||
6 to R.drawable.image_7, | ||
7 to R.drawable.image_8, | ||
8 to R.drawable.image_9, | ||
9 to R.drawable.image_10, | ||
10 to R.drawable.image_11, | ||
11 to R.drawable.image_12, | ||
12 to R.drawable.image_13, | ||
13 to R.drawable.image_14, | ||
14 to R.drawable.image_15, | ||
15 to R.drawable.image_16, | ||
16 to R.drawable.image_17, | ||
17 to R.drawable.image_18, | ||
18 to R.drawable.image_19, | ||
19 to R.drawable.image_20, | ||
20 to R.drawable.image_21, | ||
21 to R.drawable.image_22, | ||
22 to R.drawable.image_23, | ||
23 to R.drawable.image_24, | ||
24 to R.drawable.image_25, | ||
25 to R.drawable.image_26, | ||
26 to R.drawable.image_27, | ||
27 to R.drawable.image_28, | ||
28 to R.drawable.image_29, | ||
29 to R.drawable.image_30, | ||
30 to R.drawable.image_31, | ||
31 to R.drawable.image_32, | ||
32 to R.drawable.image_33, | ||
33 to R.drawable.image_34, | ||
34 to R.drawable.image_35, | ||
35 to R.drawable.image_36, | ||
36 to R.drawable.image_37, | ||
37 to R.drawable.image_38, | ||
38 to R.drawable.image_39, | ||
39 to R.drawable.image_40, | ||
40 to R.drawable.image_41, | ||
41 to R.drawable.image_42, | ||
42 to R.drawable.image_43, | ||
43 to R.drawable.image_44, | ||
44 to R.drawable.image_45, | ||
45 to R.drawable.image_46, | ||
46 to R.drawable.image_47, | ||
47 to R.drawable.image_48, | ||
48 to R.drawable.image_49, | ||
49 to R.drawable.image_50, | ||
50 to R.drawable.image_51, | ||
51 to R.drawable.image_52, | ||
52 to R.drawable.image_53, | ||
53 to R.drawable.image_54 | ||
) | ||
} | ||
//package uz.gita.memorygame.data | ||
// | ||
//import uz.gita.memorygame.R | ||
// | ||
//object ImagesMapper { | ||
// val map = mapOf( | ||
// 0 to R.drawable.image_1, | ||
// 1 to R.drawable.image_2, | ||
// 2 to R.drawable.image_3, | ||
// 3 to R.drawable.image_4, | ||
// 4 to R.drawable.image_5, | ||
// 5 to R.drawable.image_6, | ||
// 6 to R.drawable.image_7, | ||
// 7 to R.drawable.image_8, | ||
// 8 to R.drawable.image_9, | ||
// 9 to R.drawable.image_10, | ||
// 10 to R.drawable.image_11, | ||
// 11 to R.drawable.image_12, | ||
// 12 to R.drawable.image_13, | ||
// 13 to R.drawable.image_14, | ||
// 14 to R.drawable.image_15, | ||
// 15 to R.drawable.image_16, | ||
// 16 to R.drawable.image_17, | ||
// 17 to R.drawable.image_18, | ||
// 18 to R.drawable.image_19, | ||
// 19 to R.drawable.image_20, | ||
// 20 to R.drawable.image_21, | ||
// 21 to R.drawable.image_22, | ||
// 22 to R.drawable.image_23, | ||
// 23 to R.drawable.image_24, | ||
// 24 to R.drawable.image_25, | ||
// 25 to R.drawable.image_26, | ||
// 26 to R.drawable.image_27, | ||
// 27 to R.drawable.image_28, | ||
// 28 to R.drawable.image_29, | ||
// 29 to R.drawable.image_30, | ||
// 30 to R.drawable.image_31, | ||
// 31 to R.drawable.image_32, | ||
// 32 to R.drawable.image_33, | ||
// 33 to R.drawable.image_34, | ||
// 34 to R.drawable.image_35, | ||
// 35 to R.drawable.image_36, | ||
// 36 to R.drawable.image_37, | ||
// 37 to R.drawable.image_38, | ||
// 38 to R.drawable.image_39, | ||
// 39 to R.drawable.image_40, | ||
// 40 to R.drawable.image_41, | ||
// 41 to R.drawable.image_42, | ||
// 42 to R.drawable.image_43, | ||
// 43 to R.drawable.image_44, | ||
// 44 to R.drawable.image_45, | ||
// 45 to R.drawable.image_46, | ||
// 46 to R.drawable.image_47, | ||
// 47 to R.drawable.image_48, | ||
// 48 to R.drawable.image_49, | ||
// 49 to R.drawable.image_50, | ||
// 50 to R.drawable.image_51, | ||
// 51 to R.drawable.image_52, | ||
// 52 to R.drawable.image_53, | ||
// 53 to R.drawable.image_54 | ||
// ) | ||
//} |
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 |
---|---|---|
@@ -1,4 +1,7 @@ | ||
package uz.gita.memorygame.domain | ||
|
||
import uz.gita.memorygame.data.CardData | ||
|
||
interface AppRepository { | ||
fun getCardsByLevel(countX: Int, countY: Int) : List<Int> | ||
} |
73 changes: 72 additions & 1 deletion
73
app/src/main/java/uz/gita/memorygame/domain/impl/AppRepositoryImpl.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 |
---|---|---|
@@ -1,7 +1,78 @@ | ||
package uz.gita.memorygame.domain.impl | ||
|
||
import uz.gita.memorygame.R | ||
import uz.gita.memorygame.data.CardData | ||
import uz.gita.memorygame.domain.AppRepository | ||
import javax.inject.Inject | ||
import javax.inject.Singleton | ||
|
||
class AppRepositoryImpl : AppRepository { | ||
@Singleton | ||
class AppRepositoryImpl @Inject constructor( | ||
|
||
) : AppRepository { | ||
private val imageIDList = listOf<Int>( | ||
R.drawable.image_1, | ||
R.drawable.image_2, | ||
R.drawable.image_3, | ||
R.drawable.image_4, | ||
R.drawable.image_5, | ||
R.drawable.image_6, | ||
R.drawable.image_7, | ||
R.drawable.image_8, | ||
R.drawable.image_9, | ||
R.drawable.image_10, | ||
R.drawable.image_11, | ||
R.drawable.image_12, | ||
R.drawable.image_13, | ||
R.drawable.image_14, | ||
R.drawable.image_15, | ||
R.drawable.image_16, | ||
R.drawable.image_17, | ||
R.drawable.image_18, | ||
R.drawable.image_19, | ||
R.drawable.image_20, | ||
R.drawable.image_21, | ||
R.drawable.image_22, | ||
R.drawable.image_23, | ||
R.drawable.image_24, | ||
R.drawable.image_25, | ||
R.drawable.image_26, | ||
R.drawable.image_27, | ||
R.drawable.image_28, | ||
R.drawable.image_29, | ||
R.drawable.image_30, | ||
R.drawable.image_31, | ||
R.drawable.image_32, | ||
R.drawable.image_33, | ||
R.drawable.image_34, | ||
R.drawable.image_35, | ||
R.drawable.image_36, | ||
R.drawable.image_37, | ||
R.drawable.image_38, | ||
R.drawable.image_39, | ||
R.drawable.image_40, | ||
R.drawable.image_41, | ||
R.drawable.image_42, | ||
R.drawable.image_43, | ||
R.drawable.image_44, | ||
R.drawable.image_45, | ||
R.drawable.image_46, | ||
R.drawable.image_47, | ||
R.drawable.image_48, | ||
R.drawable.image_49, | ||
R.drawable.image_50, | ||
R.drawable.image_51, | ||
R.drawable.image_52, | ||
R.drawable.image_53, | ||
R.drawable.image_54 | ||
) | ||
|
||
override fun getCardsByLevel(countX: Int, countY: Int): List<Int> { | ||
val result = ArrayList<Int>() | ||
|
||
val images = imageIDList.shuffled().subList(0, countX * countY / 2) | ||
repeat(2) {result.addAll(images)} | ||
|
||
return result.shuffled() | ||
} | ||
} |
Oops, something went wrong.