本文整理汇总了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();
}
示例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();
}
示例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();
}
示例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();
}
示例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;
}