diff --git a/app/src/main/java/org/prolibertate/games/game/Catalog.kt b/app/src/main/java/org/prolibertate/games/game/Catalog.kt index ed028bf..f0dcd2a 100644 --- a/app/src/main/java/org/prolibertate/games/game/Catalog.kt +++ b/app/src/main/java/org/prolibertate/games/game/Catalog.kt @@ -362,12 +362,7 @@ object GameCatalog { maxPlayers = 4, teamBased = false, blurb = "Trade, build, and settle the island, in the base game or Cities & Knights.", - // Engine and screen exist but have not been verified on two real - // devices yet. Dev builds can open it as a *Preview*; a production - // build does not list it. Flip `available` on, and `devPreview` - // off, once two-device play has been verified. - available = false, - devPreview = true, + available = true, ), GameDescriptor( id = MEOWDOKU, @@ -378,8 +373,7 @@ object GameCatalog { teamBased = false, blurb = "One cat in every row, column and colour, and no two touching. " + "Wrong taps cost a heart; the board only ever accepts a cat that belongs.", - available = false, - devPreview = true, + available = true, ), ) diff --git a/app/src/test/java/org/prolibertate/games/game/CatalogTest.kt b/app/src/test/java/org/prolibertate/games/game/CatalogTest.kt index c3043ec..f5e7d74 100644 --- a/app/src/test/java/org/prolibertate/games/game/CatalogTest.kt +++ b/app/src/test/java/org/prolibertate/games/game/CatalogTest.kt @@ -106,42 +106,33 @@ class CatalogTest { } @Test - fun `every reference game in the catalogue can be played`() { - // Every game the app ships is playable. The exceptions are the games - // whose engine and screen exist but have not been verified on a real - // device yet: they are marked as previews so a production build keeps - // them out while a dev one can open them. `available = false` is what - // keeps an unverified game out of a production build while leaving it - // visible on a dev one. - assertEquals( - listOf(GameCatalog.CATAN, GameCatalog.MEOWDOKU), - GameCatalog.all.filterNot { it.available }.map { it.id }, - ) - // It is also the only difference the two channels see in a menu. - // Katan sits under Board and Meowdoku under Solitaire, so the two - // channels part ways in different sections. - val hiddenFromBoard = GameCatalog.inMenu(GameMenu.BOARD, includeComingSoon = true) - - GameCatalog.inMenu(GameMenu.BOARD, includeComingSoon = false) - assertEquals(listOf(GameCatalog.byId(GameCatalog.CATAN)!!), hiddenFromBoard) - val hiddenFromSolitaire = GameCatalog.inMenu(GameMenu.SOLITAIRE, includeComingSoon = true) - - GameCatalog.inMenu(GameMenu.SOLITAIRE, includeComingSoon = false) - assertEquals(listOf(GameCatalog.byId(GameCatalog.MEOWDOKU)!!), hiddenFromSolitaire) + fun `every game in the catalogue can be played`() { + // `available` is the release gate. Nothing is held back at the moment, + // so a production menu lists every game; a game parked behind the gate + // belongs in `devPreview`, and must say so rather than being quietly + // unavailable everywhere. + GameCatalog.all.filterNot { it.available }.forEach { game -> + assertTrue("${game.id} is unavailable but not a dev preview", game.devPreview) + } + GameMenu.entries.forEach { menu -> + val held = GameCatalog.inMenu(menu, includeComingSoon = true) - + GameCatalog.inMenu(menu, includeComingSoon = false).toSet() + held.forEach { assertTrue("${it.id} hidden from production without a preview flag", it.devPreview) } + } } @Test fun `a preview game opens on a dev build and nowhere else`() { - // Katan until its two-device play is verified; Meowdoku until its board - // and hearts have been looked at on a real screen. - val preview = GameCatalog.all.filter { it.devPreview } - assertEquals( - setOf(GameCatalog.CATAN, GameCatalog.MEOWDOKU), - preview.map { it.id }.toSet(), - ) - preview.forEach { game -> + GameCatalog.all.filter { it.devPreview }.forEach { game -> assertFalse("${game.id}: preview is for games that are not yet available", game.available) assertTrue("${game.id} should open on a dev build", game.playableIn(devBuild = true)) assertFalse("${game.id} must not open in production", game.playableIn(devBuild = false)) } + // The two games that were once previews now open everywhere. + listOf(GameCatalog.CATAN, GameCatalog.MEOWDOKU).forEach { id -> + val game = GameCatalog.byId(id)!! + assertTrue("$id should open in production", game.playableIn(devBuild = false)) + } // An ordinary finished game opens everywhere. val chess = GameCatalog.byId(GameCatalog.CHESS)!! assertTrue(chess.playableIn(devBuild = true) && chess.playableIn(devBuild = false)) @@ -186,6 +177,8 @@ class CatalogTest { GameCatalog.MASTERMIND, GameCatalog.BACKGAMMON, GameCatalog.PIRATES, + GameCatalog.CATAN, + GameCatalog.MEOWDOKU, ), GameCatalog.playable.map { it.id }.toSet(), )