Exemplo n.º 1
0
 /// <summary>get a free element from HeroInfoCacheList</summary>
 public global::cs.HeroEnterViewInfo GetFreeHeroInfoElement()
 {
     global::cs.HeroEnterViewInfo ret = null;
     if (HeroInfoCacheList.Count > 0)
     {
         ret = HeroInfoCacheList[0];
         HeroInfoCacheList.RemoveAt(0);
     }
     else
     {
         ret = new global::cs.HeroEnterViewInfo();
     }
     return(ret);
 }
Exemplo n.º 2
0
        /// <summary>return a free element to HeroInfoCacheList</summary>
        public void ReturnHeroInfoElement(global::cs.HeroEnterViewInfo element)
        {
            bool alreadyInList = false;

            for (int i = 0; i < HeroInfoCacheList.Count; ++i)
            {
                if (HeroInfoCacheList[i] == element)
                {
                    alreadyInList = true;
                    break;
                }
            }
            if (!alreadyInList)
            {
                element.Clear();
                HeroInfoCacheList.Add(element);
            }
        }