public partial class Players : Node , IReadOnlyCollection { public Player ByPeerId(int peerId) => this.GetNodeOrThrow(peerId.ToString()); // IReadOnlyCollection implementation public int Count => GetChildCount(); public IEnumerator GetEnumerator() => GetChildren().Cast().GetEnumerator(); System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() => GetEnumerator(); }