本文整理汇总了C#中ConfigCacheSet.GetFirstGrid方法的典型用法代码示例。如果您正苦于以下问题:C# ConfigCacheSet.GetFirstGrid方法的具体用法?C# ConfigCacheSet.GetFirstGrid怎么用?C# ConfigCacheSet.GetFirstGrid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConfigCacheSet
的用法示例。
在下文中一共展示了ConfigCacheSet.GetFirstGrid方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InitMagicEmbattle
/// <summary>
/// 初始化魔法阵
/// </summary>
/// <param name="userId"></param>
/// <param name="userLv"></param>
private static void InitMagicEmbattle(string userId, short userLv)
{
List<UserMagic> userMagicList = new GameDataCacheSet<UserMagic>().FindAll(userId, m => m.MagicType == MagicType.MoFaZhen && m.MagicID != new GameUser().UserMagicID);
if (userMagicList.Count == 0)
{
List<MagicInfo> magicInfoList = new ConfigCacheSet<MagicInfo>().FindAll(m => m.MagicType == MagicType.MoFaZhen && m.DemandLv <= userLv);
foreach (var magicInfo in magicInfoList)
{
var userMagic = new GameDataCacheSet<UserMagic>().FindKey(userId, magicInfo.MagicID);
if (userMagic != null) continue;
userMagic = new UserMagic
{
UserID = userId,
MagicID = magicInfo.MagicID,
MagicLv = magicInfo.MagicLv,
MagicType = magicInfo.MagicType,
IsEnabled = false
};
new GameDataCacheSet<UserMagic>().Add(userMagic);
MagicLvInfo magicLvInfo = new ConfigCacheSet<MagicLvInfo>().FindKey(magicInfo.MagicID, magicInfo.MagicLv);
short position = magicLvInfo.GetFirstGrid();
var userEmbattle = new UserEmbattle
{
UserID = userId,
GeneralID = 0, // LanguageManager.GetLang().GameUserGeneralID,
MagicID = magicInfo.MagicID,
Position = position
};
new GameDataCacheSet<UserEmbattle>().Add(userEmbattle);
}
}
//UserEmbattle
}