mirror of
https://github.com/gkd-kit/gkd.git
synced 2024-11-16 03:32:38 +08:00
feat(selector): export connectKeys
This commit is contained in:
parent
7d96c5f886
commit
8a8de5d801
|
@ -11,6 +11,7 @@ class CommonSelector private constructor(
|
|||
) {
|
||||
val tracks = selector.tracks
|
||||
val trackIndex = selector.trackIndex
|
||||
val connectKeys = selector.connectKeys
|
||||
|
||||
fun <T : Any> match(node: T, transform: CommonTransform<T>): T? {
|
||||
return selector.match(node, transform.transform)
|
||||
|
|
|
@ -23,6 +23,17 @@ class Selector internal constructor(private val propertyWrapper: PropertyWrapper
|
|||
if (i < 0) 0 else i
|
||||
}
|
||||
|
||||
val connectKeys by lazy {
|
||||
var c = propertyWrapper.to
|
||||
val keys = mutableListOf<String>()
|
||||
while (c != null) {
|
||||
c!!.connectSegment.connectExpression
|
||||
keys.add(c!!.connectSegment.operator.key)
|
||||
c = c?.to?.to
|
||||
}
|
||||
keys.toTypedArray()
|
||||
}
|
||||
|
||||
fun <T> match(
|
||||
node: T,
|
||||
transform: Transform<T>,
|
||||
|
|
Loading…
Reference in New Issue
Block a user