Here's an example of how you can create a generic modal logic system class that implements the IEnumerable
interface:
main.cs424 chars25 lines
This class uses a List<T>
to store the values and implements the Add
method to add new values to the list. It also implements the IEnumerable<T>
interface and provides the GetEnumerator
method to allow enumeration of the values in the list.
You can use this class like this:
main.cs203 chars11 lines
This will output:
main.cs6 chars4 lines
gistlibby LogSnag