mirror of
https://github.com/cmclark00/mintris.git
synced 2025-05-18 05:15:20 +01:00
refactor: Rename Tetris to Quad and fix related compilation errors
This commit is contained in:
parent
ce85debfe5
commit
eb962268ca
14 changed files with 139 additions and 57 deletions
|
@ -214,6 +214,7 @@ class MainActivity : AppCompatActivity(),
|
|||
// Set up game view
|
||||
gameView.setGameBoard(gameBoard)
|
||||
gameView.setHaptics(gameHaptics)
|
||||
gameBoard.setStatsManager(statsManager)
|
||||
|
||||
// Set up theme selector
|
||||
themeSelector.onThemeSelected = { themeId: String ->
|
||||
|
@ -301,7 +302,16 @@ class MainActivity : AppCompatActivity(),
|
|||
statsManager.updateSessionStats(finalScore, gameBoard.lines, piecesPlaced, timePlayedMs, currentLevel)
|
||||
|
||||
// Handle progression - XP earned, potential level up
|
||||
val xpGained = progressionManager.calculateGameXP(finalScore, gameBoard.lines, currentLevel, timePlayedMs, statsManager.getSessionTetrises(), 0)
|
||||
val xpGained = progressionManager.calculateGameXP(
|
||||
score = finalScore,
|
||||
linesCleared = gameBoard.lines,
|
||||
level = currentLevel,
|
||||
gameTime = timePlayedMs,
|
||||
tSpins = statsManager.getSessionTSpins(),
|
||||
combos = statsManager.getSessionMaxCombo(),
|
||||
quadCount = statsManager.getSessionQuads(),
|
||||
perfectClearCount = statsManager.getSessionPerfectClears()
|
||||
)
|
||||
val newRewards = progressionManager.addXP(xpGained)
|
||||
|
||||
// Show progression screen if player earned XP
|
||||
|
@ -468,12 +478,14 @@ class MainActivity : AppCompatActivity(),
|
|||
|
||||
// Calculate XP earned
|
||||
val xpGained = progressionManager.calculateGameXP(
|
||||
score = score,
|
||||
lines = gameBoard.lines,
|
||||
score = statsManager.getSessionScore(),
|
||||
linesCleared = statsManager.getSessionLines(),
|
||||
level = currentLevel,
|
||||
gameTime = gameTime,
|
||||
tetrisCount = statsManager.getSessionTetrises(),
|
||||
perfectClearCount = 0 // Implement perfect clear tracking if needed
|
||||
tSpins = statsManager.getSessionTSpins(),
|
||||
combos = statsManager.getSessionMaxCombo(),
|
||||
quadCount = statsManager.getSessionQuads(),
|
||||
perfectClearCount = statsManager.getSessionPerfectClears()
|
||||
)
|
||||
|
||||
// Add XP and check for rewards
|
||||
|
@ -496,7 +508,7 @@ class MainActivity : AppCompatActivity(),
|
|||
binding.sessionSinglesText.text = getString(R.string.singles, statsManager.getSessionSingles())
|
||||
binding.sessionDoublesText.text = getString(R.string.doubles, statsManager.getSessionDoubles())
|
||||
binding.sessionTriplesText.text = getString(R.string.triples, statsManager.getSessionTriples())
|
||||
binding.sessionTetrisesText.text = getString(R.string.tetrises, statsManager.getSessionTetrises())
|
||||
binding.sessionQuadsText.text = getString(R.string.quads, statsManager.getSessionQuads())
|
||||
|
||||
// Flag to track if high score screen will be shown
|
||||
var showingHighScore = false
|
||||
|
@ -911,7 +923,16 @@ class MainActivity : AppCompatActivity(),
|
|||
statsManager.updateSessionStats(finalScore, gameBoard.lines, piecesPlaced, timePlayedMs, currentLevel)
|
||||
|
||||
// Handle progression - XP earned, potential level up
|
||||
val xpGained = progressionManager.calculateGameXP(finalScore, gameBoard.lines, currentLevel, timePlayedMs, statsManager.getSessionTetrises(), 0)
|
||||
val xpGained = progressionManager.calculateGameXP(
|
||||
score = finalScore,
|
||||
linesCleared = gameBoard.lines,
|
||||
level = currentLevel,
|
||||
gameTime = timePlayedMs,
|
||||
tSpins = statsManager.getSessionTSpins(),
|
||||
combos = statsManager.getSessionMaxCombo(),
|
||||
quadCount = statsManager.getSessionQuads(),
|
||||
perfectClearCount = statsManager.getSessionPerfectClears()
|
||||
)
|
||||
val newRewards = progressionManager.addXP(xpGained)
|
||||
|
||||
// Show progression screen if player earned XP
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue