当前位置: 首页>>代码示例>>C#>>正文


C# TList.ToArray方法代码示例

本文整理汇总了C#中TList.ToArray方法的典型用法代码示例。如果您正苦于以下问题:C# TList.ToArray方法的具体用法?C# TList.ToArray怎么用?C# TList.ToArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TList的用法示例。


在下文中一共展示了TList.ToArray方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetTargetUnit

 /// <summary>
 /// 获取攻击单位
 /// </summary>
 /// <param name="position">攻击方的位置</param>
 /// <param name="attackType">攻击方式</param>
 /// <param name="attackTaget">攻击目标</param>
 /// <param name="targetEmbattle"></param>
 private static CombatGeneral[] GetTargetUnit(int position, AttackUnit attackType, AttackTaget attackTaget, EmbattleQueue targetEmbattle)
 {
     IGeneral[] generalList = new IGeneral[0];
     TList<CombatGeneral> targetGeneralList = new TList<CombatGeneral>();
     switch (attackType)
     {
         case AttackUnit.Single:
             CombatGeneral cg = null;
             if (attackTaget == AttackTaget.Self)
             {
                 cg = (CombatGeneral)targetEmbattle.GetGeneral(position);
             }
             else
             {
                 cg = (CombatGeneral)targetEmbattle.FindGeneral(position);
             }
             if (cg != null)
             {
                 generalList = new IGeneral[] { cg };
             }
             break;
         case AttackUnit.Horizontal:
             generalList = targetEmbattle.FindHorizontal(position);
             break;
         case AttackUnit.Vertical:
             generalList = targetEmbattle.FindVertical(position);
             break;
         case AttackUnit.All:
             generalList = targetEmbattle.FindAll();
             break;
         default:
             break;
     }
     foreach (IGeneral general in generalList)
     {
         targetGeneralList.Add((CombatGeneral)general);
     }
     return targetGeneralList.ToArray();
 }
开发者ID:rongxiong,项目名称:Scut,代码行数:46,代码来源:CombatBaseAttack.cs

示例2: GetMorePlotList

        /// <summary>
        /// 可创建多人副本列表
        /// </summary>
        /// <returns></returns>
        public MorePlot[] GetMorePlotList()
        {
            TList<MorePlot> morePlotsList = new TList<MorePlot>();
            var plotsArray = UserPlotHelper.UserPlotFindAll(_userId);
                // todo new GameDataCacheSet<UserPlot>().FindAll(_userId);)
            foreach (UserPlotInfo plot in plotsArray)
            {
                var morePlotArray = new ConfigCacheSet<PlotInfo>().FindAll(u => u.PlotType == PlotType.MorePlot && u.PrePlotID == plot.PlotID);

                if (morePlotArray.Count > 0)
                {
                    var morePlot = morePlotArray[0];
                    if (IsCombat(morePlot.PlotID))
                    {
                        morePlotsList.Add(GetItem(morePlot.PlotID));
                    }
                }
            }
            return morePlotsList.ToArray();
        }
开发者ID:rongxiong,项目名称:Scut,代码行数:24,代码来源:PlotTeamCombat.cs

示例3: GetActiveList

 public GameActive[] GetActiveList(FunctionEnum activeType)
 {
     TList<GameActive> activeList = new TList<GameActive>();
     foreach (var gameActive in _gameActiveList)
     {
         if (gameActive.ActiveType != FunctionEnum.Gonghui && (gameActive.ActiveType != activeType ||
             new GameDataCacheSet<UserFunction>().FindKey(_userId, gameActive.ActiveType) == null)) continue;
         activeList.Add(gameActive);
         if (activeType == FunctionEnum.Gonghui)
         {
             if (gameActive.ActiveType == FunctionEnum.Gonghui)
             {
                 GameUser userInfo = new GameDataCacheSet<GameUser>().FindKey(_userId);
                 if (userInfo != null)
                 {
                     UserGuild guild = new ShareCacheStruct<UserGuild>().FindKey(userInfo.MercenariesID);
                     if (guild != null)
                     {
                         GuildLvInfo lvInfo = new ConfigCacheSet<GuildLvInfo>().FindKey(guild.GuildLv);
                         if (lvInfo != null)
                         {
                             var activityArray = lvInfo.ActivityDesc;
                             foreach (ActivityShow activityShow in activityArray)
                             {
                                 if (activityShow.ActivityID == (int)gameActive.ActiveStyle)
                                 {
                                     activeList.Add(gameActive);
                                 }
                             }
                         }
                     }
                 }
             }
         }
     };
     return activeList.ToArray();
 }
开发者ID:rongxiong,项目名称:Scut,代码行数:37,代码来源:GameActiveCenter.cs

示例4: GetMorePlotFestivalList

 /// <summary>
 /// 可创建活动多人副本列表
 /// </summary>
 /// <returns></returns>
 public MorePlot[] GetMorePlotFestivalList(FunctionEnum functionEnum)
 {
     TList<MorePlot> morePlotsList = new TList<MorePlot>();
     var morePlotArray = new List<PlotInfo>();
     if (functionEnum == FunctionEnum.MorePlotCoin)
     {
         morePlotArray = new ConfigCacheSet<PlotInfo>().FindAll(m => m.PlotType == PlotType.MorePlotCoin);
     }
     else if (functionEnum == FunctionEnum.MorePlotEnergy)
     {
         morePlotArray = new ConfigCacheSet<PlotInfo>().FindAll(m => m.PlotType == PlotType.MorePlotEnergy);
     }
     if (morePlotArray.Count > 0)
     {
         //var morePlot = morePlotArray[0];
         foreach (PlotInfo info in morePlotArray)
         {
             if (functionEnum == FunctionEnum.MorePlotCoin && IsMoreCombat(info.PlotID))
             {
                 morePlotsList.Add(GetItem(info.PlotID));
             }
             else if (functionEnum == FunctionEnum.MorePlotEnergy && IsMoreCombat(info.PlotID))
             {
                 morePlotsList.Add(GetItem(info.PlotID));
             }
         }
     }
     return morePlotsList.ToArray();
 }
开发者ID:rongxiong,项目名称:Scut,代码行数:33,代码来源:PlotTeamCombat.cs

示例5: IsNickName

        /// <summary>
        /// ����Ƿ��������dz�
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public static bool IsNickName(string name)
        {
            //return new GameDataCacheSet<GameUser>().IsExist(u => u.NickName.ToLower() == name.ToLower().Trim());
            bool bl = false;
            bl = new GameDataCacheSet<GameUser>().IsExist(u => u.NickName.ToLower() == name.ToLower().Trim());
            if (!bl)
            {
                TList<SqlParameter> paramValues = new TList<SqlParameter>();
                string sql = "SELECT NickName FROM GameUser WHERE NickName = @NickName";
                paramValues.Add(SqlParamHelper.MakeInParam("@NickName", SqlDbType.VarChar, 0, name));
                using (SqlDataReader reader = SqlHelper.ExecuteReader(DbConfig.DataConnectString, CommandType.Text, sql, paramValues.ToArray()))
                {
                    while (reader.Read())
                    {
                        bl = true;
                    }
                }
            }

            return bl;
        }
开发者ID:rongxiong,项目名称:Scut,代码行数:26,代码来源:GameUser.cs


注:本文中的TList.ToArray方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。