small changes
This commit is contained in:
parent
a6287e1760
commit
720795cfd6
@ -1,6 +1,7 @@
|
|||||||
package adrienmalin.pingpoints
|
package adrienmalin.pingpoints
|
||||||
|
|
||||||
data class Player (
|
data class Player (
|
||||||
var name: String,
|
val name: String,
|
||||||
var score: Int
|
var score: Int,
|
||||||
|
val soundex: String = soundex(name)
|
||||||
)
|
)
|
||||||
|
@ -56,7 +56,7 @@ class SttDialog : DialogFragment() {
|
|||||||
if (matcher.find()) {
|
if (matcher.find()) {
|
||||||
val foundName = matcher.group(1)
|
val foundName = matcher.group(1)
|
||||||
for (player in players) {
|
for (player in players) {
|
||||||
if (soundex(foundName) == soundex(player.name)) {
|
if (soundex(foundName) == player.soundex) {
|
||||||
dismiss()
|
dismiss()
|
||||||
updateScore(player)
|
updateScore(player)
|
||||||
updateUI()
|
updateUI()
|
||||||
|
@ -45,7 +45,7 @@ class VictoryActivity : AppCompatActivity() {
|
|||||||
intent.getIntExtra("player2Score", 0)
|
intent.getIntExtra("player2Score", 0)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
previousMatch?.apply{ previousMatches = getString("previousMatches", "") }
|
previousMatch?.apply{ previousMatches = getString("previousMatches", "") ?: "" }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -64,7 +64,7 @@ class VictoryActivity : AppCompatActivity() {
|
|||||||
this@VictoryActivity,
|
this@VictoryActivity,
|
||||||
R.layout.grid_item,
|
R.layout.grid_item,
|
||||||
R.id.grid_item_text,
|
R.id.grid_item_text,
|
||||||
previousMatches.split("\t|\n".toRegex())?.toMutableList()
|
previousMatches.split("\t|\n".toRegex()).toMutableList()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user