Modern Apps git

← Modern-Apps.git

games/wordmaker: document public API for detekt

Commit
103c05d568ee6703e4617c01f9dd6bf98d83743a
Author
Vayun Mathur <[email protected]>
When
2026-11-17 14:42 UTC (19 days ago)
Parents
2c71db9
Add concise KDoc to every public class, object, interface and
enum (including nested types) that detekt's
UndocumentedPublicClass rule flagged in this module. Docs only:
no behaviour, visibility or config changes.

Verified: ./gradlew :games:wordmaker:detekt reports 0
UndocumentedPublicClass findings (pre-existing error-severity
findings in other rules, where present, are untouched), and the
module unit tests pass.

Diff

games/wordmaker/src/main/java/com/vayunmathur/games/wordmaker/MainActivity.kt
diff --git a/games/wordmaker/src/main/java/com/vayunmathur/games/wordmaker/MainActivity.kt b/games/wordmaker/src/main/java/com/vayunmathur/games/wordmaker/MainActivity.ktindex f4efba1e04..2d620027ac 100644--- a/games/wordmaker/src/main/java/com/vayunmathur/games/wordmaker/MainActivity.kt+++ b/games/wordmaker/src/main/java/com/vayunmathur/games/wordmaker/MainActivity.kt@@ -5,6 +5,7 @@ import androidx.compose.runtime.Composable import com.vayunmathur.games.wordmaker.platform.WordMakerViewModel import com.vayunmathur.library.ui.MaActivity +/** Entry activity for Word Maker; hosts the game navigation. */ class MainActivity : MaActivity() {     private val viewModel: WordMakerViewModel by viewModels() 
games/wordmaker/src/main/java/com/vayunmathur/games/wordmaker/Route.kt
diff --git a/games/wordmaker/src/main/java/com/vayunmathur/games/wordmaker/Route.kt b/games/wordmaker/src/main/java/com/vayunmathur/games/wordmaker/Route.ktindex 9ba0c1b391..2214a916db 100644--- a/games/wordmaker/src/main/java/com/vayunmathur/games/wordmaker/Route.kt+++ b/games/wordmaker/src/main/java/com/vayunmathur/games/wordmaker/Route.kt@@ -3,8 +3,10 @@ package com.vayunmathur.games.wordmaker import com.vayunmathur.library.util.NavKey import kotlinx.serialization.Serializable +/** Navigation destinations for Word Maker. */ @Serializable sealed interface Route : NavKey {+    /** Crossword board destination. */     @Serializable     data object Game : Route     /**@@ -14,8 +16,10 @@ sealed interface Route : NavKey {      */     @Serializable     data object CompetitiveLobby : Route+    /** Games Hub and achievements destination. */     @Serializable     data object GameCenter : Route+    /** Game settings destination. */     @Serializable     data object Settings : Route }
games/wordmaker/src/main/java/com/vayunmathur/games/wordmaker/data/CrosswordData.kt
diff --git a/games/wordmaker/src/main/java/com/vayunmathur/games/wordmaker/data/CrosswordData.kt b/games/wordmaker/src/main/java/com/vayunmathur/games/wordmaker/data/CrosswordData.ktindex e20aacb46e..e2e321d1f6 100644--- a/games/wordmaker/src/main/java/com/vayunmathur/games/wordmaker/data/CrosswordData.kt+++ b/games/wordmaker/src/main/java/com/vayunmathur/games/wordmaker/data/CrosswordData.kt@@ -1,6 +1,7 @@ package com.vayunmathur.games.wordmaker.data import android.content.Context +/** A crossword board: solution words, chooser letters, grid, and word placements. */ data class CrosswordData(     val solutionWords: Set<String>,     val lettersInChooser: List<Char>,@@ -39,6 +40,7 @@ data class CrosswordData(         }     } +    /** Parsers that build [CrosswordData] from asset grid text. */     companion object {         fun fromAsset(context: Context, fileName: String): CrosswordData? = try {             fromString(context.assets.open(fileName).bufferedReader().use { it.readText() })
games/wordmaker/src/main/java/com/vayunmathur/games/wordmaker/data/LevelDataStore.kt
diff --git a/games/wordmaker/src/main/java/com/vayunmathur/games/wordmaker/data/LevelDataStore.kt b/games/wordmaker/src/main/java/com/vayunmathur/games/wordmaker/data/LevelDataStore.ktindex 1c555e7e3d..55162da471 100644--- a/games/wordmaker/src/main/java/com/vayunmathur/games/wordmaker/data/LevelDataStore.kt+++ b/games/wordmaker/src/main/java/com/vayunmathur/games/wordmaker/data/LevelDataStore.kt@@ -15,9 +15,11 @@ import kotlinx.coroutines.flow.map  private val Context.dataStore: DataStore<Preferences> by preferencesDataStore(name = "settings") +/** DataStore persistence for Word Maker progress, settings, competitive score, and daily state. */ class LevelDataStore(context: Context) {      private val appContext = context.applicationContext+    /** Preference keys and saved-state helpers for [LevelDataStore]. */     companion object {         private val LEVEL_KEY = intPreferencesKey("current_level")         private val FOUND_WORDS_KEY = stringSetPreferencesKey("found_words")
games/wordmaker/src/main/java/com/vayunmathur/games/wordmaker/domain/CompetitiveLevelGenerator.kt
diff --git a/games/wordmaker/src/main/java/com/vayunmathur/games/wordmaker/domain/CompetitiveLevelGenerator.kt b/games/wordmaker/src/main/java/com/vayunmathur/games/wordmaker/domain/CompetitiveLevelGenerator.ktindex 5d9ec7d924..6f6326b53e 100644--- a/games/wordmaker/src/main/java/com/vayunmathur/games/wordmaker/domain/CompetitiveLevelGenerator.kt+++ b/games/wordmaker/src/main/java/com/vayunmathur/games/wordmaker/domain/CompetitiveLevelGenerator.kt@@ -247,6 +247,7 @@ class CompetitiveLevelGenerator(private val words: List<String>) {         }     } +    /** Generation limits and asset loading for [CompetitiveLevelGenerator]. */     companion object {         private const val COMMON_LIMIT = 20000         private const val WHEEL_ATTEMPTS = 60
games/wordmaker/src/main/java/com/vayunmathur/games/wordmaker/platform/AppBackupAgent.kt
diff --git a/games/wordmaker/src/main/java/com/vayunmathur/games/wordmaker/platform/AppBackupAgent.kt b/games/wordmaker/src/main/java/com/vayunmathur/games/wordmaker/platform/AppBackupAgent.ktindex 6cf4946cb5..12545e3880 100644--- a/games/wordmaker/src/main/java/com/vayunmathur/games/wordmaker/platform/AppBackupAgent.kt+++ b/games/wordmaker/src/main/java/com/vayunmathur/games/wordmaker/platform/AppBackupAgent.kt@@ -2,6 +2,7 @@ package com.vayunmathur.games.wordmaker.platform  import com.vayunmathur.library.util.BaseBackupAgent +/** Cloud backup rules for Word Maker DataStore files. */ class AppBackupAgent : BaseBackupAgent() {     // "settings" is LevelDataStore's preferencesDataStore(name = "settings"); datastore_default is     // the shared DataStoreUtils file, which is where DailyChallengeStore keeps the daily streak and
games/wordmaker/src/main/java/com/vayunmathur/games/wordmaker/platform/WordMakerAchievementsManager.kt
diff --git a/games/wordmaker/src/main/java/com/vayunmathur/games/wordmaker/platform/WordMakerAchievementsManager.kt b/games/wordmaker/src/main/java/com/vayunmathur/games/wordmaker/platform/WordMakerAchievementsManager.ktindex 2fcfb980e2..22c8aae007 100644--- a/games/wordmaker/src/main/java/com/vayunmathur/games/wordmaker/platform/WordMakerAchievementsManager.kt+++ b/games/wordmaker/src/main/java/com/vayunmathur/games/wordmaker/platform/WordMakerAchievementsManager.kt@@ -9,6 +9,7 @@ import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.flow.first import kotlinx.coroutines.launch +/** Unlocks Word Maker achievements from level progress, bonus words, and daily streaks. */ class WordMakerAchievementsManager(     context: Context,     json: String,
games/wordmaker/src/main/java/com/vayunmathur/games/wordmaker/platform/WordMakerUiContract.kt
diff --git a/games/wordmaker/src/main/java/com/vayunmathur/games/wordmaker/platform/WordMakerUiContract.kt b/games/wordmaker/src/main/java/com/vayunmathur/games/wordmaker/platform/WordMakerUiContract.ktindex 800b532e60..2803a2c160 100644--- a/games/wordmaker/src/main/java/com/vayunmathur/games/wordmaker/platform/WordMakerUiContract.kt+++ b/games/wordmaker/src/main/java/com/vayunmathur/games/wordmaker/platform/WordMakerUiContract.kt@@ -66,6 +66,7 @@ interface WordGameActions {     /** Records a bonus word and returns the player's new bonus total. */     suspend fun addBonusWord(word: String): Int = 0 +    /** Factories for [WordGameActions]. */     companion object {         val Noop: WordGameActions = object : WordGameActions {}     }@@ -77,6 +78,7 @@ interface CompetitiveLobbyActions {     fun setDifficulty(difficulty: Difficulty) {}     fun loadNextCompetitiveLevel() {} +    /** Factories for [CompetitiveLobbyActions]. */     companion object {         val Noop: CompetitiveLobbyActions = object : CompetitiveLobbyActions {}     }@@ -98,6 +100,7 @@ interface SettingsActions {     fun setReminderEnabled(enabled: Boolean) {}     fun setReminderTime(hour: Int, minute: Int) {} +    /** Factories for [SettingsActions]. */     companion object {         val Noop: SettingsActions = object : SettingsActions {}     }
games/wordmaker/src/main/java/com/vayunmathur/games/wordmaker/platform/WordMakerViewModel.kt
diff --git a/games/wordmaker/src/main/java/com/vayunmathur/games/wordmaker/platform/WordMakerViewModel.kt b/games/wordmaker/src/main/java/com/vayunmathur/games/wordmaker/platform/WordMakerViewModel.ktindex 2c5cfe86e9..8e4238c672 100644--- a/games/wordmaker/src/main/java/com/vayunmathur/games/wordmaker/platform/WordMakerViewModel.kt+++ b/games/wordmaker/src/main/java/com/vayunmathur/games/wordmaker/platform/WordMakerViewModel.kt@@ -33,6 +33,7 @@ import kotlin.random.Random /** Outcome of a finished competitive level, shown on the between-levels lobby. */ data class CompetitiveResult(val won: Boolean, val delta: Int) +/** ViewModel for Word Maker crossword, competitive, and daily play. */ class WordMakerViewModel(application: Application) : AndroidViewModel(application),     WordGameActions, CompetitiveLobbyActions { @@ -476,6 +477,7 @@ class WordMakerViewModel(application: Application) : AndroidViewModel(applicatio         }     } +    /** Constants for daily play and level generation in [WordMakerViewModel]. */     companion object {         /** Namespace shared by the daily-challenge store and its reminder. */         const val DAILY_KEY_PREFIX = "wordmaker_daily"
games/wordmaker/src/main/java/com/vayunmathur/games/wordmaker/ui/ChooserLetter.kt
diff --git a/games/wordmaker/src/main/java/com/vayunmathur/games/wordmaker/ui/ChooserLetter.kt b/games/wordmaker/src/main/java/com/vayunmathur/games/wordmaker/ui/ChooserLetter.ktindex 1aaa4f265f..b3c7c3106e 100644--- a/games/wordmaker/src/main/java/com/vayunmathur/games/wordmaker/ui/ChooserLetter.kt+++ b/games/wordmaker/src/main/java/com/vayunmathur/games/wordmaker/ui/ChooserLetter.kt@@ -1,2 +1,3 @@ package com.vayunmathur.games.wordmaker.ui+/** One letter tile in the chooser, with a stable identity for animation. */ data class ChooserLetter(val id:Int,val char:Char)
games/wordmaker/src/main/java/com/vayunmathur/games/wordmaker/ui/components/WordComponents.kt
diff --git a/games/wordmaker/src/main/java/com/vayunmathur/games/wordmaker/ui/components/WordComponents.kt b/games/wordmaker/src/main/java/com/vayunmathur/games/wordmaker/ui/components/WordComponents.ktindex dc8df4487a..dd980e3923 100644--- a/games/wordmaker/src/main/java/com/vayunmathur/games/wordmaker/ui/components/WordComponents.kt+++ b/games/wordmaker/src/main/java/com/vayunmathur/games/wordmaker/ui/components/WordComponents.kt@@ -24,6 +24,7 @@ import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.em import androidx.compose.ui.unit.sp +/** A letter in flight from the chooser to its grid cell. */ data class AnimatedLetter(     val char: Char,     val startOffset: Offset,@@ -31,6 +32,7 @@ data class AnimatedLetter(     val progress: Animatable<Float, AnimationVector1D> ) +/** A completed word queued for letter-flight animation. */ data class WordToAnimate(val word: String, val letterIds: List<Int>)  /**