本文整理汇总了C#中Skill.GetLeftPointsRequiredToLevel方法的典型用法代码示例。如果您正苦于以下问题:C# Skill.GetLeftPointsRequiredToLevel方法的具体用法?C# Skill.GetLeftPointsRequiredToLevel怎么用?C# Skill.GetLeftPointsRequiredToLevel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Skill
的用法示例。
在下文中一共展示了Skill.GetLeftPointsRequiredToLevel方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetTooltip
/// <summary>
/// Gets the tooltip text for the given skill
/// </summary>
/// <param name="skill"></param>
private static string GetTooltip(Skill skill)
{
Int64 sp = skill.SkillPoints;
Int64 nextLevel = Math.Min(5, skill.Level + 1);
Int64 nextLevelSP = skill.StaticData.GetPointsRequiredForLevel(nextLevel);
Int64 pointsLeft = skill.GetLeftPointsRequiredToLevel(nextLevel);
string remainingTimeText = skill.GetLeftTrainingTimeToLevel(nextLevel)
.ToDescriptiveText(DescriptiveTextOptions.IncludeCommas | DescriptiveTextOptions.UppercaseText);
if (sp < skill.StaticData.GetPointsRequiredForLevel(1))
{
// Training hasn't got past level 1 yet
StringBuilder untrainedToolTip = new StringBuilder();
untrainedToolTip
.Append($"Not yet trained to Level I ({Math.Floor(skill.PercentCompleted)}%)")
.AppendLine()
.Append($"Next level I: {pointsLeft:N0} skill points remaining")
.AppendLine()
.Append($"Training time remaining: {remainingTimeText}")
.AppendLine();
AddSkillBoilerPlate(untrainedToolTip, skill);
return untrainedToolTip.ToString();
}
// So, it's a left click on a skill, we display the tool tip
// Partially trained skill ?
if (skill.IsPartiallyTrained)
{
StringBuilder partiallyTrainedToolTip = new StringBuilder();
partiallyTrainedToolTip
.Append($"Partially Completed ({Math.Floor(skill.PercentCompleted)}%)")
.AppendLine()
.Append($"Training to level {Skill.GetRomanFromInt(nextLevel)}: {pointsLeft:N0} skill points remaining")
.AppendLine()
.Append($"Training time remaining: {remainingTimeText}")
.AppendLine();
AddSkillBoilerPlate(partiallyTrainedToolTip, skill);
return partiallyTrainedToolTip.ToString();
}
// We've completed all the skill points for the current level
if (!skill.IsPartiallyTrained)
{
if (skill.Level != 5)
{
StringBuilder levelCompleteToolTip = new StringBuilder();
levelCompleteToolTip
.Append($"Completed Level {Skill.GetRomanFromInt(skill.Level)}: {sp:N0}/{nextLevelSP:N0}")
.AppendLine()
.Append($"Next level {Skill.GetRomanFromInt(nextLevel)}: {pointsLeft:N0} skill points required")
.AppendLine()
.Append($"Training Time: {remainingTimeText}")
.AppendLine();
AddSkillBoilerPlate(levelCompleteToolTip, skill);
return levelCompleteToolTip.ToString();
}
// Lv 5 completed
StringBuilder lv5ToolTip = new StringBuilder();
lv5ToolTip
.Append($"Level V Complete: {sp:N0}/{nextLevelSP:N0}")
.AppendLine()
.AppendLine("No further training required");
AddSkillBoilerPlate(lv5ToolTip, skill);
return lv5ToolTip.ToString();
}
// Error in calculating SkillPoints
StringBuilder calculationErrorToolTip = new StringBuilder();
calculationErrorToolTip
.AppendLine("Partially Trained (Could not cacluate all skill details)")
.Append($"Next level {nextLevel}: {pointsLeft:N0} skill points remaining")
.AppendLine()
.Append($"Training time remaining: {remainingTimeText}")
.AppendLine();
AddSkillBoilerPlate(calculationErrorToolTip, skill);
return calculationErrorToolTip.ToString();
}