Files
Githug-Android/app/src/main/java/solutions/tretter/githugandroid/GameModels.kt
Joe Tretter 4bac818571 Align level parity docs and fetch/status validation
- Add LevelsCompare.md with setup and validation comparisons against Gazler/githug.
- Document that LevelsCompare.md must be updated when level behavior changes.
- Track FETCH_HEAD count in RepoState so the Fetch level can match upstream validation.
- Mirror upstream Status setup with staged files plus untracked database.yml.
- Keep Fetch from being solved by pull despite native Git FETCH_HEAD behavior.
- Bump app version and build debug APK.
2026-05-11 21:36:12 -05:00

59 lines
1.6 KiB
Kotlin

package solutions.tretter.githugandroid
enum class PlayMode(val label: String) {
CLI_ONLY("CLI ONLY"),
VISUAL("VISUAL"),
}
data class GitFile(
val name: String,
val content: String = "",
val staged: Boolean = false,
val tracked: Boolean = false,
val deleted: Boolean = false,
)
data class CommitNode(
val id: String,
val message: String,
)
data class RepoState(
val initialized: Boolean = false,
val files: List<GitFile> = emptyList(),
val commits: List<CommitNode> = emptyList(),
val headBranch: String = "master",
val branches: Map<String, Int> = emptyMap(),
val currentDir: String = ".",
val tags: List<String> = emptyList(),
val remotes: Map<String, String> = emptyMap(),
val config: Map<String, String> = emptyMap(),
val stashes: List<String> = emptyList(),
val fetchedBranches: Set<String> = emptySet(),
val fetchHeadCount: Int = 0,
val pushedBranches: Set<String> = emptySet(),
val pushedTags: Set<String> = emptySet(),
val submodules: Map<String, String> = emptyMap(),
val maintenanceActions: Set<String> = emptySet(),
)
data class Level(
val id: String,
val title: String,
val description: String,
val hints: List<String>,
val commandSuggestions: List<String>,
val validator: (RepoState, String) -> Boolean,
val setup: () -> RepoState,
val nativeSetup: (NativeLevelSetup.() -> Boolean)? = null,
val testCases: List<LevelTestCase> = emptyList(),
)
data class LevelTestCase(
val name: String,
val commands: List<String>,
)
fun sampleLevels(): List<Level> = allGithugLevels()