// Filename : CECShopArrayItems.cs // Creator : Xu Wenbin // Date : 2013/12/11 // Converted to C#: 2024 using System.Collections.Generic; using System.Linq; namespace PerfectWorld.Scripts.Shop { public abstract class CECShopArrayItems : CECShopBase { protected List m_pItems; public CECShopArrayItems(List pItems) { m_pItems = pItems; } public override int GetCount() { return m_pItems != null ? m_pItems.Count : 0; } public override GShopItem? GetItem(int index) { if (m_pItems != null && index >= 0 && index < m_pItems.Count) { return m_pItems[index]; } return null; } public static bool IsSame(List lhs, List rhs) { bool result = false; if (lhs == rhs) { result = true; } else if (lhs != null && rhs != null) { if (lhs.Count == rhs.Count) { result = true; for (int u = 0; u < lhs.Count; ++u) { if (!CECShopBase.IsSame(lhs[u], rhs[u])) { result = false; break; } } } } return result; } } }