usedSessions method

Set<int> usedSessions()

The distinct session salts present across every id in the document.

A new editing session for this document should allocate with these excluded so freshly minted ids cannot collide with existing ones.

Implementation

Set<int> usedSessions() {
  final sessions = <int>{};
  void add(LocalId id) => sessions.add(id.session);
  nodes.keys.forEach(add);
  resources.keys.forEach(add);
  skins.keys.forEach(add);
  animations.keys.forEach(add);
  payloads.keys.forEach(add);
  return sessions;
}