Exemplo n.º 1
0
    /// <summary>
    /// 新的一波
    /// </summary>
    void SetNewWave()
    {
        m_trans_BattleContent.gameObject.SetActive(true);
        m_trans_DesAndCD.gameObject.SetActive(true);

        //波数
        m_trans_Round.gameObject.SetActive(true);
        if (NWManager.CopyWave > 0)
        {
            m_label_NvWaRoundNum.text = string.Format("{0}", NWManager.CopyWave);
        }
        else
        {
            m_label_NvWaRoundNum.text = "";
        }

        //下方的描述信息
        uint copyId = DataManager.Manager <ComBatCopyDataManager>().EnterCopyID;
        CopyDisplayDataBase cddb = GameTableManager.Instance.GetTableItem <CopyDisplayDataBase>(copyId, (int)NWManager.CopyWave);

        if (cddb != null)
        {
            m_label_battleDes.text = cddb.des;
        }
        else
        {
            m_label_battleDes.text = "";
        }
    }
Exemplo n.º 2
0
        /// <summary>
        /// 通过[副本ID]二分快速查表
        /// </summary>
        /// <param name="copyId">副本ID</param>
        /// <returns></returns>
        public static IEnumerable <CopyDisplayDataBase> Query(this List <CopyDisplayDataBase> sorted, uint copyId)
        {
            var key = new CopyDisplayDataBase()
            {
                copyId = copyId
            };
            var comparer = new Comparer1();
            var from     = sorted.BinarySearch(key, comparer);

            if (from < 0)
            {
                yield break;
            }
            var to = from + 1;

            while (from > 0 && comparer.Compare(key, sorted[from - 1]) == 0)
            {
                from--;
            }
            while (to < sorted.Count && comparer.Compare(key, sorted[to]) == 0)
            {
                to++;
            }
            for (var i = from; i < to; i++)
            {
                yield return(sorted[i]);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// 通过[副本ID + 波数]二分快速查表
        /// </summary>
        /// <param name="copyId">副本ID</param>
        /// <param name="waveId">波数</param>
        /// <returns></returns>
        public static CopyDisplayDataBase Query(this List <CopyDisplayDataBase> sorted, uint copyId, uint waveId)
        {
            var key = new CopyDisplayDataBase()
            {
                copyId = copyId, waveId = waveId
            };
            var comparer = new Comparer2();
            var index    = sorted.BinarySearch(key, comparer);

            return(index >= 0 ? sorted[index] : default(CopyDisplayDataBase));
        }