本文整理匯總了C#中ZyGames.Tianjiexing.Model.GameUser.GetSportsCombat方法的典型用法代碼示例。如果您正苦於以下問題:C# GameUser.GetSportsCombat方法的具體用法?C# GameUser.GetSportsCombat怎麽用?C# GameUser.GetSportsCombat使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ZyGames.Tianjiexing.Model.GameUser
的用法示例。
在下文中一共展示了GameUser.GetSportsCombat方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: GetRewardGameCoin
/// <summary>
/// 連勝金幣獎勵
/// </summary>
/// <param name="userID"></param>
/// <returns></returns>
public static int GetRewardGameCoin(GameUser user, short userLv)
{
int rewardGameCoin = 0;
IList<SportsCombat> toUserCombat = user.GetSportsCombat();
if (toUserCombat.Count > 0)
{
var temp = toUserCombat[toUserCombat.Count - 1];
if (temp.WinNum > 10)
{
rewardGameCoin = (int)(userLv * 40 * 1.2);
}
else if (temp.WinNum > 20)
{
rewardGameCoin = (int)(userLv * 40 * 1.5);
}
else if (temp.WinNum > 50)
{
rewardGameCoin = (int)(userLv * 40 * 2);
}
else if (temp.WinNum > 100)
{
rewardGameCoin = (int)(userLv * 40 * 3);
}
else
{
rewardGameCoin = (int)(userLv * 40);
}
}
else
{
rewardGameCoin = (int)(userLv * 40);
}
if (rewardGameCoin.IsValid())
{
return rewardGameCoin;
}
throw new ArgumentOutOfRangeException(string.Format("User:{0}連勝金幣獎勵溢出:{1}", user.UserID, rewardGameCoin));
}