colyseus-unity-sdk
colyseus-unity-sdk copied to clipboard
Improve use of generics and privacy levels in `ArraySchema` and `MapSchema`
-
ArraySchema's method signatures forGetItems(),GetByIndex(index),ContainsKey(key),GetTypeDefaultValue(),SetItems(), andInvokeOn{Add,Change,Remove}()should use typeT. - The
Itemsmember should probably be private. - It seems like there are some methods that manage internal details which shouldn't be public (eg.
GetIndex(index)without theByin the name, and anything that hasdynamicIndexin its signature). - Similar improvements can be made to
MapSchema.
Thanks for the feedback @rnd256, I agree completely, all these methods should be for internal usage only and not exposed. I hope we can tackle this sooner or later.
I think the methods in the first bullet point I mention should remain public, but agreed on making the other ones private.