fix: 完善路口和电子眼渲染样式

This commit is contained in:
2023-06-26 14:56:29 +08:00
parent 3d4d6c13a7
commit 8551ce43a7
6 changed files with 23 additions and 117 deletions

View File

@@ -38,7 +38,7 @@ class ImportConfig {
if (renderEntity.properties.containsKey(k)) { // json配置的key可以匹配到数据
for (v in processKeyOrValue(value)) {
if ("~" == v ) { // ~符可以匹配任意元素
if (valuelib.endsWith("()")) { // 以()结尾说明该value配置是一个function需要通过反射调用指定方法
if (valuelib.endsWith(")")) { // 以()结尾说明该value配置是一个function需要通过反射调用指定方法
// 获取方法名
val methodName = valuelib.substringBefore("(")
// 获取参数
@@ -51,8 +51,9 @@ class ImportConfig {
methodParams[1] to renderEntity
)
for ((index, value) in params.withIndex()) {
if (methodParams.size>index+1) {
callByParams[methodParams[index+1]] = value
// 前2个参数确定为对象本身和RenderEntity因此自定义参数从index+2开始设置
if (methodParams.size>index+2) {
callByParams[methodParams[index+2]] = value
}
}
when(val result = method.callBy(callByParams)) { // 如果方法返回的数据类型是boolean且返回为false则该数据不处理
@@ -66,7 +67,7 @@ class ImportConfig {
}
break@m
} else if (renderEntity.properties[k] == v) { // 完全匹配
if (valuelib.endsWith("()")) { // 以()结尾说明该value配置是一个function需要通过反射调用指定方法
if (valuelib.endsWith(")")) { // 以()结尾说明该value配置是一个function需要通过反射调用指定方法
// 获取方法名
val methodName = valuelib.substringBefore("(")
// 获取参数
@@ -79,8 +80,9 @@ class ImportConfig {
methodParams[1] to renderEntity
)
for ((index, value) in params.withIndex()) {
if (methodParams.size>index+1) {
callByParams[methodParams[index+1]] = value
// 前2个参数确定为对象本身和RenderEntity因此自定义参数从index+2开始设置
if (methodParams.size>index+2) {
callByParams[methodParams[index+2]] = value
}
}
when(val result = method.callBy(callByParams)) {