public void AddItem(Controllers.Item item) { if (m_characterTeamModel.Items == null) { m_characterTeamModel.Items = new List <string>(); } if (m_items == null) { m_items = new List <Item>(); } if (m_items.Contains(item)) { return; } Controllers.Item sameTypefounded = null; if ((sameTypefounded = m_items.Find(x => x.Type == item.Type)) != null) { m_items.Remove(sameTypefounded); } m_characterTeamModel.Items.Add(item.Id); m_items.Add(item); }
public void RemoveItem(Controllers.Item item) { m_characterTeamModel.Items.Remove(item.Id); m_items.Remove(item); }