feat(game): stub wild battle flow with catch, bag, switching, field state, and flee

This commit is contained in:
Fiereu committed 2026-07-19 22:35:04 +02:00
1 parent 9732c9373c
commit d618cff20e
92 files changed
+1499 -272

No files matched your search

@@ -1,5 +1,8 @@
package de.fiereu.bytecodec
import java.time.LocalDateTime
import java.time.ZoneOffset
object Bool : Codec<Boolean> {
override fun read(buf: ReadBuffer): Boolean = buf.readByte() != 0.toByte()
@@ -219,6 +222,16 @@ object F64BE : Codec<Double> {
}
}
/** Unix timestamp as little-endian signed 32-bit seconds, exposed as a UTC [LocalDateTime]. */
object TimestampLE : Codec<LocalDateTime> {
override fun read(buf: ReadBuffer): LocalDateTime =
LocalDateTime.ofEpochSecond(S32LE.read(buf).toLong(), 0, ZoneOffset.UTC)
override fun write(buf: WriteBuffer, value: LocalDateTime) {
S32LE.write(buf, value.toEpochSecond(ZoneOffset.UTC).toInt())
}
}
fun fixedBytes(n: Int): Codec<ByteArray> {
require(n >= 0) { "fixedBytes negative size: $n" }
return object : Codec<ByteArray> {