mirror of
https://github.com/RDCN-Community-Developers/rdkt.git
synced 2026-09-04 17:25:33 +08:00
Added test for SetVFXPresetEvent.
This commit is contained in:
@@ -339,7 +339,7 @@ public sealed interface VFXPreset {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
@SerialName("Blur")
|
@SerialName("RadialBlur")
|
||||||
public class RadialBlur(
|
public class RadialBlur(
|
||||||
override var enable: Boolean,
|
override var enable: Boolean,
|
||||||
override var rooms: Rooms,
|
override var rooms: Rooms,
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package cn.rdlevel.rdkt.core.test
|
||||||
|
|
||||||
|
import cn.rdlevel.rdkt.core.data.ROOM1
|
||||||
|
import cn.rdlevel.rdkt.core.data.action.VFXPreset
|
||||||
|
import cn.rdlevel.rdkt.core.data.roomsOf
|
||||||
|
import cn.rdlevel.rdkt.core.events.Event
|
||||||
|
import cn.rdlevel.rdkt.core.events.SetVFXPresetEvent
|
||||||
|
import kotlinx.serialization.ExperimentalSerializationApi
|
||||||
|
import kotlinx.serialization.json.Json
|
||||||
|
import kotlin.test.Test
|
||||||
|
|
||||||
|
class SetVFXPresetEventTest {
|
||||||
|
@OptIn(ExperimentalSerializationApi::class)
|
||||||
|
@Test
|
||||||
|
fun test() {
|
||||||
|
val json = Json {
|
||||||
|
isLenient = true
|
||||||
|
allowTrailingComma = true
|
||||||
|
encodeDefaults = true
|
||||||
|
}
|
||||||
|
val event: Event = SetVFXPresetEvent(VFXPreset.Embers(true, roomsOf(ROOM1)))
|
||||||
|
val text = json.encodeToString(event)
|
||||||
|
println(text)
|
||||||
|
val event2: Event = json.decodeFromString(text)
|
||||||
|
println(event2)
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user