I have multiple lists of type ArmorBase and WeaponBase that inherit the ItemBase class.
I also have a List that represents the current selected item List
public List<ItemBase> currentItemBasesList;
public List<ArmorBase> helmetBasesList;
public List<ArmorBase> chestplateBasesList;
public List<ArmorBase> shoulderguardsBasesList;
public List<ArmorBase> armguardsBasesList;
public List<ArmorBase> thighguardsBasesList;
public List<ArmorBase> bootsBasesList;
public List<ArmorBase> shieldBasesList;
public List<ArmorBase> capeBasesList;
public List<WeaponBase> weaponBasesList;
But I am having trouble when assigning these lists to the List currentItemBasesList.
My first thought was:
currentItemBasesList = chestplateBasesList.Cast<ItemBase>().ToList();
My problem is that this way I break the referente to the List chestplateBasesList; So if I remove any item from the List currentItemBasesList, it doesnt update in the List chestplateBasesList.
What are my options in this case? Thanks in advance
Bruno Pasini Fiorini is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.