Formatting #2 (#59)

This commit is contained in:
Kamron Batman 2019-10-05 00:37:03 -07:00 • committed by GitHub
parent 096d39609e
commit 8e9221bb5a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
400 changed files with 3688 additions and 5969 deletions

View file

@ -162,44 +162,26 @@ namespace Server.Engines.ConPVP
int y = 53;
string groupText = null;
switch (tourney.GroupType)
var groupText = tourney.GroupType switch
{
case GroupingType.HighVsLow:
groupText = "High vs Low";
break;
case GroupingType.Nearest:
groupText = "Closest opponent";
break;
case GroupingType.Random:
groupText = "Random";
break;
}
GroupingType.HighVsLow => "High vs Low",
GroupingType.Nearest => "Closest opponent",
GroupingType.Random => "Random",
_ => null
};
AddHtml(35, y, 190, 20, $"Grouping: {groupText}");
y += 20;
string tieText = null;
switch (tourney.TieType)
var tieText = tourney.TieType switch
{
case TieType.Random:
tieText = "Random";
break;
case TieType.Highest:
tieText = "Highest advances";
break;
case TieType.Lowest:
tieText = "Lowest advances";
break;
case TieType.FullAdvancement:
tieText = tourney.ParticipantsPerMatch == 2 ? "Both advance" : "Everyone advances";
break;
case TieType.FullElimination:
tieText = tourney.ParticipantsPerMatch == 2 ? "Both eliminated" : "Everyone eliminated";
break;
}
TieType.Random => "Random",
TieType.Highest => "Highest advances",
TieType.Lowest => "Lowest advances",
TieType.FullAdvancement => (tourney.ParticipantsPerMatch == 2 ? "Both advance" : "Everyone advances"),
TieType.FullElimination => (tourney.ParticipantsPerMatch == 2 ? "Both eliminated" : "Everyone eliminated"),
_ => null
};
AddHtml(35, y, 190, 20, $"Tiebreaker: {tieText}");
y += 20;
@ -352,7 +334,7 @@ namespace Server.Engines.ConPVP
AddHtml(25, 53, 250, 20, $"Name: {mob.Name}");
AddHtml(25, 73, 250, 20,
$"Guild: {(mob.Guild == null ? "None" : mob.Guild.Name + " [" + mob.Guild.Abbreviation + "]")}");
$"Guild: {(mob.Guild == null ? "None" : $"{mob.Guild.Name} [{mob.Guild.Abbreviation}]")}");
AddHtml(25, 93, 250, 20, $"Rank: {(entry == null ? "N/A" : LadderGump.Rank(entry.Index + 1))}");
AddHtml(25, 113, 250, 20, $"Level: {(entry == null ? 0 : Ladder.GetLevel(entry.Experience))}");
AddHtml(25, 133, 250, 20, $"Wins: {entry?.Wins ?? 0:N0}");
@ -375,7 +357,7 @@ namespace Server.Engines.ConPVP
StartPage(out int index, out int count, out int y, 12);
for (int i = 0; i < count; ++i, y += 18)
AddRightArrow(25, y, ToButtonID(3, index + i), "Round #" + (index + i + 1));
AddRightArrow(25, y, ToButtonID(3, index + i), $"Round #{index + i + 1}");
break;
}