com.unity.netcode.gameobjects icon indicating copy to clipboard operation
com.unity.netcode.gameobjects copied to clipboard

Make NetworkList implement IList or ICollection

Open Reag opened this issue 2 years ago • 1 comments

Is your feature request related to a problem? Please describe. I want to do some basic processing of the underlying data in a network list of locations (For example, determine which of the lat/lon pairs is closest to the current users map center). Currently, to do so, I must build some unusual wrappers to allow me to process this data using LINQ, UniTask, or other generic libraries.

Describe the solution you'd like Having NetworkList implement some basic interfaces for Lists would be very useful in this regard. I understand that ownership becomes an issue, but it would hopefully not be insurmountable. I would very much like to be able to write

sharedLocations.AddRange(SomeOtherCollection);

Describe alternatives you've considered Im considering making my own NetworkList extension. We'll see how it goes :3

Additional context I know this shouldn't be the highest priority, but its something small that bugs me. After all, its called a NetworkList, but doesnt implement any of the interfaces required for something to be considered a list. This sits badly with me.

Reag avatar Aug 20 '23 06:08 Reag

This is a duplicate of https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/issues/2123

tangx246 avatar Aug 25 '23 23:08 tangx246