I have two lists that I want to combine into one. One list has a class of member and one has a class for equipment.
I’d like each member to have their name and their equipment listed.
Tom Dick Harry
knife m-16 p90
pistol revolver Colt 45
Do I need a dictionary for this? I’ve tried a combination class
CombineClass Both = new CombineClass(){MemberList=MemberList, EquipmentList=EquipmentList };
It compiles, but I don’t know how to see how to check the data, like I could with a list.count. I know TUPLE is not supported. I’ve tried Ienumerable, concat, and cast using LINQ
IEnumerable all = MemberList.Cast ().Concat (EquipmentList.Cast ());
Again, I don’t know how to work with it to see if it did what I wanted it to.
Anyone have any solutions? I’m open.
Thanks!
Perhaps with a struct, that has a slot for member and another one for equipment and a list of that struct?
– Destolospublic class CombineClass : MonoBehaviour { public List<Members> MemberList; public List<Equipment> EquipmentList; } Something like this?
– Gilead7At that point how do I add the lists? Add? AddRange(which will only work with an iemumerator), put it into a dictionary or something else?
– Gilead7