本文整理汇总了C#中GameDataCacheSet.ResetSweepPool方法的典型用法代码示例。如果您正苦于以下问题:C# GameDataCacheSet.ResetSweepPool方法的具体用法?C# GameDataCacheSet.ResetSweepPool怎么用?C# GameDataCacheSet.ResetSweepPool使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GameDataCacheSet
的用法示例。
在下文中一共展示了GameDataCacheSet.ResetSweepPool方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RefleshPrize
/// <summary>
/// 刷新副本奖励
/// </summary>
/// <param name="userID"></param>
/// <param name="plotID"></param>
public static bool RefleshPrize(string userID, int plotID)
{
int turnsNum = 0;
int battleNum = 0;
List<UserQueue> queueList = new GameDataCacheSet<UserQueue>().FindAll(userID, m => m.QueueType == QueueType.SaoDang);
if (queueList.Count == 0)
{
return false;
}
UserQueue saodangQueue = queueList[0];
var npcList = new ConfigCacheSet<PlotNPCInfo>().FindAll(m => m.PlotID == plotID);
int npcCount = npcList.Count;
GameUser gameUser = new GameDataCacheSet<GameUser>().FindKey(userID);
while (HasSweep(userID, plotID, saodangQueue.GetTiming(), npcCount, out turnsNum, out battleNum))
{
int tempbattleNum = 0;
if (gameUser.SweepPool.TurnsNum > 0)
{
tempbattleNum = (gameUser.SweepPool.TurnsNum - 1) * npcCount + gameUser.SweepPool.BattleNum;
}
tempbattleNum += 1;
turnsNum = GetTurnsNum(npcCount, tempbattleNum);
battleNum = GetTimesNum(npcCount, tempbattleNum);
DoPlotSweepPrize(userID, plotID, turnsNum, battleNum, npcCount);
if (gameUser.SweepPool.TurnsNum < turnsNum)
{
if (gameUser.SurplusEnergy > 0)
{
//每轮扣一次精力
gameUser.SurplusEnergy = MathUtils.Subtraction(gameUser.SurplusEnergy, PlotInfo.BattleEnergyNum, (short)0);
}
else
{
//每轮扣一次精力
gameUser.EnergyNum = MathUtils.Subtraction(gameUser.EnergyNum, PlotInfo.BattleEnergyNum, (short)0);
}
}
gameUser.SweepPool.UpdateNotify(obj =>
{
gameUser.SweepPool.PlotID = plotID;
gameUser.SweepPool.TurnsNum = turnsNum;
gameUser.SweepPool.BattleNum = battleNum;
return true;
});
//gameUser.Update();
}
if (saodangQueue.DoRefresh() == 0)
{
if (gameUser.UserStatus != UserStatus.Normal)
{
var cacheSet = new GameDataCacheSet<UserQueue>();
cacheSet.Delete(saodangQueue);
gameUser.UserStatus = UserStatus.Normal;
gameUser.ResetSweepPool(0);
//gameUser.Update();
}
}
return true;
}