-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Experimental | Update Item&Fix&Improve
- Loading branch information
1 parent
412c123
commit 6ef9735
Showing
15 changed files
with
212 additions
and
232 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 1 addition & 7 deletions
8
project/module-item/src/main/kotlin/cn/fd/ratziel/module/item/api/builder/ItemGenerator.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
.../module-item/src/main/kotlin/cn/fd/ratziel/module/item/api/builder/ItemSectionResolver.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package cn.fd.ratziel.module.item.api.builder | ||
|
||
import cn.fd.ratziel.core.serialization.MutableJsonObject | ||
import cn.fd.ratziel.core.serialization.asMutable | ||
import cn.fd.ratziel.function.argument.ArgumentFactory | ||
import cn.fd.ratziel.module.item.api.ArgumentResolver | ||
import kotlinx.serialization.json.JsonElement | ||
import kotlinx.serialization.json.JsonObject | ||
|
||
/** | ||
* ItemSectionResolver | ||
* | ||
* @author TheFloodDragon | ||
* @since 2024/5/24 20:53 | ||
*/ | ||
interface ItemSectionResolver : ItemResolver { | ||
|
||
fun resolveWith(builder: MutableJsonObject, arguments: ArgumentFactory): JsonElement | ||
|
||
fun resolveWith(element: JsonElement, arguments: ArgumentFactory): JsonElement | ||
|
||
override fun resolve(element: JsonElement, arguments: ArgumentFactory): JsonElement = | ||
if (element is JsonObject) resolveWith(element.asMutable(), arguments) | ||
else resolveWith(element, arguments) | ||
|
||
interface TagResolver : ArgumentResolver<Iterable<String>, String?> { | ||
|
||
/** | ||
* 解析器名称 | ||
*/ | ||
val name: String | ||
|
||
/** | ||
* 解析器别名 | ||
*/ | ||
val alias: Array<String> | ||
|
||
} | ||
|
||
} |
21 changes: 0 additions & 21 deletions
21
...t/module-item/src/main/kotlin/cn/fd/ratziel/module/item/api/common/NamedStringResolver.kt
This file was deleted.
Oops, something went wrong.
9 changes: 0 additions & 9 deletions
9
project/module-item/src/main/kotlin/cn/fd/ratziel/module/item/api/common/StringResolver.kt
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.