Make a new type that essentially acts like another
In my project, I've found that Im making a lot of structs/classes that are essentially containers for other stuff. Example:
How can I make a type that essentially acts like that
ArrayInstanceData[] Data
?5 Replies
So you want to make a class that behaves like a collection?
yeah
Alright, well you'll want to implement
this[int index]
so the collection can be indexed
use Collection<T>
https://learn.microsoft.com/en-us/dotnet/api/system.collections.objectmodel.collection-1?view=net-7.0, check example 2
Collection Class (System.Collections.ObjectModel)
Provides the base class for a generic collection.