diff --git a/benchmark/src/androidTest/java/com/vitorpamplona/quartz/benchmark/GiftWrapReceivingBenchmark.kt b/benchmark/src/androidTest/java/com/vitorpamplona/quartz/benchmark/GiftWrapReceivingBenchmark.kt index 9f364ba56..62c3e676a 100644 --- a/benchmark/src/androidTest/java/com/vitorpamplona/quartz/benchmark/GiftWrapReceivingBenchmark.kt +++ b/benchmark/src/androidTest/java/com/vitorpamplona/quartz/benchmark/GiftWrapReceivingBenchmark.kt @@ -170,7 +170,7 @@ class GiftWrapReceivingBenchmark { wrap.pubKey.hexToByteArray(), ) - benchmarkRule.measureRepeated { assertNotNull(innerJson?.let { Event.fromJson(it) }) } + benchmarkRule.measureRepeated { assertNotNull(innerJson.let { Event.fromJson(it) }) } } @Test @@ -205,6 +205,6 @@ class GiftWrapReceivingBenchmark { seal.pubKey.hexToByteArray(), ) - benchmarkRule.measureRepeated { assertNotNull(innerJson?.let { Rumor.fromJson(it) }) } + benchmarkRule.measureRepeated { assertNotNull(innerJson.let { Rumor.fromJson(it) }) } } } diff --git a/benchmark/src/androidTest/java/com/vitorpamplona/quartz/benchmark/GiftWrapSigningBenchmark.kt b/benchmark/src/androidTest/java/com/vitorpamplona/quartz/benchmark/GiftWrapSigningBenchmark.kt index ce0ffccaf..1395ab720 100644 --- a/benchmark/src/androidTest/java/com/vitorpamplona/quartz/benchmark/GiftWrapSigningBenchmark.kt +++ b/benchmark/src/androidTest/java/com/vitorpamplona/quartz/benchmark/GiftWrapSigningBenchmark.kt @@ -138,7 +138,7 @@ class GiftWrapSigningBenchmark { benchmarkRule.measureRepeated { runBlocking { GiftWrapEvent.create( - event = seal!!, + event = seal, recipientPubKey = receiver.pubKey, ) } diff --git a/quartz/src/androidHostTest/kotlin/com/vitorpamplona/quartz/TestResourceLoader.android.kt b/quartz/src/androidHostTest/kotlin/com/vitorpamplona/quartz/TestResourceLoader.android.kt new file mode 100644 index 000000000..34edaf77c --- /dev/null +++ b/quartz/src/androidHostTest/kotlin/com/vitorpamplona/quartz/TestResourceLoader.android.kt @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2025 Vitor Pamplona + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +package com.vitorpamplona.quartz + +actual class TestResourceLoader actual constructor() { + actual fun loadString(file: String): String { + TODO("Not yet implemented") + } +} diff --git a/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/TestResourceLoader.kt b/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/TestResourceLoader.kt index 81c31d65b..633888a45 100644 --- a/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/TestResourceLoader.kt +++ b/quartz/src/commonTest/kotlin/com/vitorpamplona/quartz/TestResourceLoader.kt @@ -20,26 +20,6 @@ */ package com.vitorpamplona.quartz -/** - * Copyright (c) 2025 Vitor Pamplona - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the - * Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ expect class TestResourceLoader() { fun loadString(file: String): String } diff --git a/quartz/src/iosMain/kotlin/com/vitorpamplona/quartz/nip64Chess/ChessEngine.ios.kt b/quartz/src/iosMain/kotlin/com/vitorpamplona/quartz/nip64Chess/ChessEngine.ios.kt new file mode 100644 index 000000000..a87275781 --- /dev/null +++ b/quartz/src/iosMain/kotlin/com/vitorpamplona/quartz/nip64Chess/ChessEngine.ios.kt @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2025 Vitor Pamplona + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +package com.vitorpamplona.quartz.nip64Chess + +actual class ChessEngine actual constructor() { + actual fun getFen(): String { + TODO("Not yet implemented") + } + + actual fun loadFen(fen: String) { + } + + actual fun reset() { + } + + actual fun makeMove(san: String): MoveResult { + TODO("Not yet implemented") + } + + actual fun makeMove( + from: String, + to: String, + promotion: PieceType?, + ): MoveResult { + TODO("Not yet implemented") + } + + actual fun getLegalMoves(): List { + TODO("Not yet implemented") + } + + actual fun getLegalMovesFrom(square: String): List { + TODO("Not yet implemented") + } + + actual fun isLegalMove(san: String): Boolean { + TODO("Not yet implemented") + } + + actual fun isLegalMove( + from: String, + to: String, + promotion: PieceType?, + ): Boolean { + TODO("Not yet implemented") + } + + actual fun isCheckmate(): Boolean { + TODO("Not yet implemented") + } + + actual fun isStalemate(): Boolean { + TODO("Not yet implemented") + } + + actual fun isInCheck(): Boolean { + TODO("Not yet implemented") + } + + actual fun undoMove() { + } + + actual fun getPosition(): ChessPosition { + TODO("Not yet implemented") + } + + actual fun getSideToMove(): Color { + TODO("Not yet implemented") + } + + actual fun getMoveHistory(): List { + TODO("Not yet implemented") + } +}