本文整理汇总了C#中ShareCacheStruct.GetFirstGrid方法的典型用法代码示例。如果您正苦于以下问题:C# ShareCacheStruct.GetFirstGrid方法的具体用法?C# ShareCacheStruct.GetFirstGrid怎么用?C# ShareCacheStruct.GetFirstGrid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ShareCacheStruct
的用法示例。
在下文中一共展示了ShareCacheStruct.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 PersonalCacheStruct<UserMagic>().FindAll(userId, m => m.MagicType == MagicType.MoFaZhen && m.MagicID != new GameUser().UserMagicID);
if (userMagicList.Count == 0)
{
List<MagicInfo> magicInfoList = new ShareCacheStruct<MagicInfo>().FindAll(m => m.MagicType == MagicType.MoFaZhen && m.DemandLv <= userLv);
foreach (var magicInfo in magicInfoList)
{
var userMagic = new PersonalCacheStruct<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 PersonalCacheStruct<UserMagic>().Add(userMagic);
MagicLvInfo magicLvInfo = new ShareCacheStruct<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 PersonalCacheStruct<UserEmbattle>().Add(userEmbattle);
}
}
//UserEmbattle
}