Skip to content

Commit

Permalink
pref: 优化 KMarkdown内的部分 object
Browse files Browse the repository at this point in the history
  • Loading branch information
ForteScarlet committed Feb 5, 2024
1 parent 423b14c commit 76acc61
Showing 1 changed file with 18 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
/*
* Copyright (c) 2023. ForteScarlet.
* Copyright (c) 2023-2024. ForteScarlet.
*
* This file is part of simbot-component-kook.
* This file is part of simbot-component-kook.
*
* simbot-component-kook is free software: you can redistribute it and/or modify it under the terms of
* the GNU Lesser General Public License as published by the Free Software Foundation,
* either version 3 of the License, or (at your option) any later version.
* simbot-component-kook is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* simbot-component-kook is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Lesser General Public License for more details.
* simbot-component-kook is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along with simbot-component-kook,
* If not, see <https://www.gnu.org/licenses/>.
* You should have received a copy of the GNU Lesser General Public License
* along with simbot-component-kook,
* If not, see <https://www.gnu.org/licenses/>.
*/

@file:Suppress("unused")
Expand Down Expand Up @@ -408,15 +411,15 @@ public interface KookMarkdownGrammar<P> {
public sealed class Source(public open val name: String) {

/** 来源 - markdown官方 */
public object Markdown : Source("official")
public data object Markdown : Source("official")

/** 来源 - Kook 官方 */
public sealed class Kook(name: String) : Source(name) {
/** Kook 官方 - 自定义 */
public object Custom : Kook("kook-custom")
public data object Custom : Kook("kook-custom")

/** Kook 官方 - emoji */
public object Emoji : Kook("kook-emoji")
public data object Emoji : Kook("kook-emoji")
}

/** 其他自定义 */
Expand Down Expand Up @@ -619,7 +622,7 @@ public sealed class AtTarget : CharSequence {
*
* @see AtTarget
*/
public object All : AtTarget() {
public data object All : AtTarget() {
private const val DELEGATE = "all"
override val length: Int get() = DELEGATE.length
override fun get(index: Int): Char = DELEGATE[index]
Expand All @@ -632,7 +635,7 @@ public sealed class AtTarget : CharSequence {
*
* @see AtTarget
*/
public object Here : AtTarget() {
public data object Here : AtTarget() {
private const val DELEGATE = "here"
override val length: Int get() = DELEGATE.length
override fun get(index: Int): Char = DELEGATE[index]
Expand Down

0 comments on commit 76acc61

Please sign in to comment.