Example #1
0
        //public static List<long> GetType(EThingType type, int thingCsvId)
        //{
        //    m_tempCreatureList.Clear();
        //    foreach (KeyValuePair<long, CCreature> item in m_dicPlayer)
        //    {
        //        if (item.Value.GetThingType() == type &&
        //            !item.Value.IsDie() &&
        //            item.Value.m_csvData.Id == thingCsvId)
        //        {
        //            m_tempCreatureList.Add(item.Key);
        //        }
        //    }
        //    return m_tempCreatureList;
        //}


        /// <summary>
        /// 需要在外部遍历时,创建,删除,界面调用,用这个
        /// </summary>
        public static List <long> GetType(EThingType type)
        {
            m_tempCreatureList.Clear();
            foreach (KeyValuePair <long, CCreature> item in m_dicPlayer)
            {
                if (!item.Value.m_bActive)
                {
                    continue;
                }
                if (item.Value.GetThingType() == type && !item.Value.IsDie())
                {
                    m_tempCreatureList.Add(item.Key);
                }
            }
            return(m_tempCreatureList);
        }
Example #2
0
        public static CCreature Create(EThingType type, long uid)
        {
            if (m_dicPlayer.ContainsKey(uid))
            {
                return(m_dicPlayer[uid]);
            }

            CCreature cc = null;

            switch (type)
            {
            case EThingType.Player:
                cc = new CPlayer(uid);
                break;
            }

            Add(uid, cc);
            //m_listAdd.Add(cc);
            return(cc);
        }
Example #3
0
 public void SetType(EThingType type)
 {
     m_type = type;
 }