Add support for LocalizedDatasets to RandomMetadata (#28601)
This commit is contained in:
@@ -12,9 +12,13 @@ namespace Content.Shared.Random.Helpers
|
||||
return random.Pick(prototype.Values);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Randomly selects an entry from <paramref name="prototype"/>, attempts to localize it, and returns the result.
|
||||
/// </summary>
|
||||
public static string Pick(this IRobustRandom random, LocalizedDatasetPrototype prototype)
|
||||
{
|
||||
return random.Pick(prototype.Values);
|
||||
var index = random.Next(prototype.Values.Count);
|
||||
return Loc.GetString(prototype.Values[index]);
|
||||
}
|
||||
|
||||
public static string Pick(this IWeightedRandomPrototype prototype, System.Random random)
|
||||
|
||||
Reference in New Issue
Block a user