Creates random element extension (#196)
This commit is contained in:
parent
0926b5abaa
commit
4403d6c1c7
84 changed files with 226 additions and 330 deletions
|
|
@ -692,7 +692,7 @@ namespace Server.Engines.ConPVP
|
|||
rn -= ae.Value;
|
||||
}
|
||||
|
||||
return arenas[Utility.Random(arenas.Count)].m_Arena;
|
||||
return arenas.RandomElement().m_Arena;
|
||||
}
|
||||
|
||||
public static Arena FindArena()
|
||||
|
|
|
|||
|
|
@ -284,7 +284,7 @@ namespace Server.Engines.ConPVP
|
|||
}
|
||||
case TieType.Random:
|
||||
{
|
||||
TourneyParticipant advanced = remaining[Utility.Random(remaining.Count)];
|
||||
TourneyParticipant advanced = remaining.RandomElement();
|
||||
|
||||
for (int i = 0; i < remaining.Count; ++i)
|
||||
if (remaining[i] != advanced)
|
||||
|
|
|
|||
|
|
@ -131,13 +131,13 @@ namespace Server.Engines.ConPVP
|
|||
if (toAdvance.Count == 0)
|
||||
toAdvance = copy; // sanity
|
||||
|
||||
int idx = Utility.Random(toAdvance.Count);
|
||||
var random = toAdvance.RandomElement();
|
||||
|
||||
toAdvance[idx].AddLog(
|
||||
random.AddLog(
|
||||
"Advanced automatically due to an odd number of challengers.");
|
||||
level.FreeAdvance = toAdvance[idx];
|
||||
level.FreeAdvance = random;
|
||||
++level.FreeAdvance.FreeAdvances;
|
||||
copy.Remove(toAdvance[idx]);
|
||||
copy.Remove(random);
|
||||
}
|
||||
|
||||
while (copy.Count >= partsPerMatch)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue