示例#1
0
        public void SetSettingScreenPriority(uint priority)
        {
            SettingDataBase data = GameTableManager.Instance.GetTableItem <SettingDataBase>(priority);

            if (data != null)
            {
                //草地扰动
                bool       grassIsOpen = (data.GrassMoveGrade != 0) ? true : false;
                IMapSystem mapSys      = ClientGlobal.Instance().GetMapSystem();
                mapSys.EnableGrassForce(grassIsOpen);

                Engine.IRenderSystem rs = Engine.RareEngine.Instance().GetRenderSystem();
                if (rs != null)
                {
                    //实时阴影
                    rs.SetShadowLevel((Engine.ShadowLevel)data.RealTime_Shadow);

                    //特效等级
                    rs.effectLevel = (int)data.ParticleGrade;
                }

                //同屏人数
                Client.IEntitySystem es = Client.ClientGlobal.Instance().GetEntitySystem();
                int value = (int)data.PlayerNum;
                if (es != null)
                {
                    if (value > MAX_PLAYER || value < MIN_PLAYER)
                    {
                        value = MIN_PLAYER;
                    }
                    es.MaxPlayer = value;
                }
            }
        }
示例#2
0
        /// <summary>
        /// 通过[id]二分快速查表
        /// </summary>
        /// <param name="id">id</param>
        /// <returns></returns>
        public static SettingDataBase Query(this List <SettingDataBase> sorted, uint id)
        {
            var key = new SettingDataBase()
            {
                id = id
            };
            var comparer = new Comparer1();
            var index    = sorted.BinarySearch(key, comparer);

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