MCPcopy Create free account
hub / github.com/bigdra50/unity-cli / _find_class_changes

Function _find_class_changes

unity_cli/api/uitree_snapshot.py:119–138  ·  view source on GitHub ↗

Find elements with changed USS classes.

(
    baseline_by_ref: dict[str, dict[str, Any]],
    current_by_ref: dict[str, dict[str, Any]],
    common_refs: set[str],
)

Source from the content-addressed store, hash-verified

117
118
119def _find_class_changes(
120 baseline_by_ref: dict[str, dict[str, Any]],
121 current_by_ref: dict[str, dict[str, Any]],
122 common_refs: set[str],
123) -> list[dict[str, Any]]:
124 """Find elements with changed USS classes."""
125 changed: list[dict[str, Any]] = []
126 for r in sorted(common_refs):
127 b = baseline_by_ref[r]
128 c = current_by_ref[r]
129 if b["classes"] != c["classes"]:
130 changed.append(
131 {
132 "ref": r,
133 "name": b.get("name", r),
134 "baseline_classes": b["classes"],
135 "current_classes": c["classes"],
136 }
137 )
138 return changed

Callers 1

_compare_elementsFunction · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected