/// <summary>get a free element from NpcInfoCacheList</summary> public global::cs.NpcEnterViewInfo GetFreeNpcInfoElement() { global::cs.NpcEnterViewInfo ret = null; if (NpcInfoCacheList.Count > 0) { ret = NpcInfoCacheList[0]; NpcInfoCacheList.RemoveAt(0); } else { ret = new global::cs.NpcEnterViewInfo(); } return(ret); }
/// <summary>return a free element to NpcInfoCacheList</summary> public void ReturnNpcInfoElement(global::cs.NpcEnterViewInfo element) { bool alreadyInList = false; for (int i = 0; i < NpcInfoCacheList.Count; ++i) { if (NpcInfoCacheList[i] == element) { alreadyInList = true; break; } } if (!alreadyInList) { element.Clear(); NpcInfoCacheList.Add(element); } }