Fix build and warnings
This commit is contained in:
@@ -20,9 +20,6 @@ namespace Content.Server.GameTicking.GameRules
|
||||
public class RuleTraitor : GameRule
|
||||
{
|
||||
[Dependency] private readonly IChatManager _chatManager = default!;
|
||||
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
||||
[Dependency] private readonly IGameTicker _gameTicker = default!;
|
||||
[Dependency] private readonly IConfigurationManager _cfg = default!;
|
||||
|
||||
public override void Added()
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace Content.Server.Objectives.Interfaces
|
||||
/// <summary>
|
||||
/// Returns all objectives the provided mind is valid for.
|
||||
/// </summary>
|
||||
IReadOnlyList<ObjectivePrototype> GetAllPossibleObjectives(Mind mind);
|
||||
IEnumerable<ObjectivePrototype> GetAllPossibleObjectives(Mind mind);
|
||||
|
||||
/// <summary>
|
||||
/// Returns a randomly picked objective the provided mind is valid for.
|
||||
|
||||
@@ -16,14 +16,14 @@ namespace Content.Server.Objectives
|
||||
[Dependency] private IPrototypeManager _prototypeManager = default!;
|
||||
[Dependency] private IRobustRandom _random = default!;
|
||||
|
||||
public List<ObjectivePrototype> GetAllPossibleObjectives(Mind mind)
|
||||
public IEnumerable<ObjectivePrototype> GetAllPossibleObjectives(Mind mind)
|
||||
{
|
||||
return _prototypeManager.EnumeratePrototypes<ObjectivePrototype>().Where(objectivePrototype => objectivePrototype.CanBeAssigned(mind)).ToList();
|
||||
return _prototypeManager.EnumeratePrototypes<ObjectivePrototype>().Where(objectivePrototype => objectivePrototype.CanBeAssigned(mind));
|
||||
}
|
||||
|
||||
public ObjectivePrototype? GetRandomObjective(Mind mind)
|
||||
{
|
||||
var objectives = GetAllPossibleObjectives(mind);
|
||||
var objectives = GetAllPossibleObjectives(mind).ToList();
|
||||
_random.Shuffle(objectives);
|
||||
|
||||
//to prevent endless loops
|
||||
|
||||
Reference in New Issue
Block a user