MiraiForum

    • Register
    • Login
    • Search
    • Popular
    • Recent
    • Unsolved
    • Tags
    • Groups
    • 友情链接

    Solved [问题] 如何自定义AutoSave(ReadOnly)PluginData(Config)的value类型

    开发交流
    3
    4
    101
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • JasonZYT
      JasonZYT last edited by

      如图,直接这样使用肯定会报错,那么如何自定义重载value函数来使得可以直接使用GameInfo数据类
      a666217c-5e23-4676-b489-eaad19014f13-image.png
      (看了下序列化那一块,头晕,有无大佬给一个更方便的方法)

      1 Reply Last reply Reply Quote 0
      • cssxsh
        cssxsh last edited by cssxsh

        序列化直接上注解不就行了吗

        import kotlinx.serialization.*
        
        @Serializable
        data class GameInfo(
        
        JasonZYT 1 Reply Last reply Reply Quote 1
        • Itsusinn
          Itsusinn last edited by

          有人不仔细看注释

          1 Reply Last reply Reply Quote 0
          • JasonZYT
            JasonZYT @cssxsh last edited by

            感谢

            1 Reply Last reply Reply Quote 0
            • 1 / 1
            • First post
              Last post
            Powered by Mamoe Technologies & NodeBB | 友情链接 | 服务监控 | Contact