Skip to content

Commit

Permalink
Make PuzzlePiece Parcelable
Browse files Browse the repository at this point in the history
  • Loading branch information
zsoltk committed Sep 27, 2023
1 parent bc96b14 commit c0ad2d0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
package com.bumble.puzzyx.model

import com.bumble.appyx.utils.multiplatform.Parcelable
import com.bumble.appyx.utils.multiplatform.Parcelize

@Parcelize
data class PuzzlePiece(
val i: Int,
val j: Int,
val entry: Entry
)
val entryId: Int
) : Parcelable
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class Puzzle1Node(
PuzzlePiece(
i = shuffledIdx % columns,
j = shuffledIdx / columns,
entry = puzzle1Entries[sequentialIdx]
entryId = sequentialIdx
)
},
savedStateMap = buildContext.savedStateMap,
Expand Down Expand Up @@ -105,7 +105,7 @@ class Puzzle1Node(
.fillMaxSize()
.background(color),
// TODO decide on the fate of this
puzzlePiece.entry as? Entry.Text ?: Entry.Text(Puzzle.PUZZLE1, "n/a")
entry = puzzle1Entries[puzzlePiece.entryId] as? Entry.Text ?: Entry.Text(Puzzle.PUZZLE1, "n/a")
)
}
)
Expand Down

0 comments on commit c0ad2d0

Please sign in to comment.