❔ ✅ Help with searching a class of classes for something?
So, i have a StartingClass, it has a list of classes, and that list has a list of classes, etc. Eventually it gets to EntryClass.
How do i search StartingClass to find the EntryClass, that THAT entryclass's
string name
is "Dog" and then put THAT entryclass's string something
into a textbox.
so like, DebugTextbox.Text = TargetEntry.Something;
but yeah, how do i search StartingClass to find the correct EntryClass and set that EntryClass as the TargetClass?3 Replies
Assuming you have this sort of structure:
Then you would need to iterate over over every
MiddleClass
inside of StartingClass
's list, and inside each one of those MiddleClass
object, iterate over that list until you find your target. So something like:
If the nesting of your classes is more "deep" you would just add more for loops.Thanks!
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.