Skip to content

Commit

Permalink
Merge pull request #9 from zsoltk/parcelable-puzzle-piece
Browse files Browse the repository at this point in the history
Make PuzzlePiece Parcelable
  • Loading branch information
zsoltk authored Sep 27, 2023
2 parents bc96b14 + c0ad2d0 commit 98a39ff
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 98a39ff

Please sign in to comment.