From 927cf7799fc45ef5726e995020de1af6b710ea29 Mon Sep 17 00:00:00 2001 From: Cojoke <83733158+Cojoke-dot@users.noreply.github.com> Date: Tue, 16 Jul 2024 02:17:18 -0500 Subject: [PATCH] Remove uses of AllObjectives (#30077) Remove the uses of AllObjectives --- Content.Server/CharacterInfo/CharacterInfoSystem.cs | 2 +- Content.Server/Dragon/DragonSystem.cs | 4 ++-- Content.Server/Objectives/Commands/ListObjectivesCommand.cs | 2 +- .../Objectives/Systems/HelpProgressConditionSystem.cs | 4 ++-- .../Objectives/Systems/ObjectiveBlacklistRequirementSystem.cs | 2 +- Content.Shared/Mind/SharedMindSystem.cs | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Content.Server/CharacterInfo/CharacterInfoSystem.cs b/Content.Server/CharacterInfo/CharacterInfoSystem.cs index df8718a022e34f..cb2216b5e3b499 100644 --- a/Content.Server/CharacterInfo/CharacterInfoSystem.cs +++ b/Content.Server/CharacterInfo/CharacterInfoSystem.cs @@ -36,7 +36,7 @@ private void OnRequestCharacterInfoEvent(RequestCharacterInfoEvent msg, EntitySe if (_minds.TryGetMind(entity, out var mindId, out var mind)) { // Get objectives - foreach (var objective in mind.AllObjectives) + foreach (var objective in mind.Objectives) { var info = _objectives.GetInfo(objective, mindId, mind); if (info == null) diff --git a/Content.Server/Dragon/DragonSystem.cs b/Content.Server/Dragon/DragonSystem.cs index 96ca8d3614a22a..e626edeb26901e 100644 --- a/Content.Server/Dragon/DragonSystem.cs +++ b/Content.Server/Dragon/DragonSystem.cs @@ -225,7 +225,7 @@ public void DeleteRifts(EntityUid uid, bool resetRole, DragonComponent? comp = n return; var mind = Comp(mindContainer.Mind.Value); - foreach (var objId in mind.AllObjectives) + foreach (var objId in mind.Objectives) { if (_objQuery.TryGetComponent(objId, out var obj)) { @@ -247,7 +247,7 @@ public void RiftCharged(EntityUid uid, DragonComponent? comp = null) return; var mind = Comp(mindContainer.Mind.Value); - foreach (var objId in mind.AllObjectives) + foreach (var objId in mind.Objectives) { if (_objQuery.TryGetComponent(objId, out var obj)) { diff --git a/Content.Server/Objectives/Commands/ListObjectivesCommand.cs b/Content.Server/Objectives/Commands/ListObjectivesCommand.cs index 97fc943269a449..88dcdcedf65a55 100644 --- a/Content.Server/Objectives/Commands/ListObjectivesCommand.cs +++ b/Content.Server/Objectives/Commands/ListObjectivesCommand.cs @@ -33,7 +33,7 @@ public override void Execute(IConsoleShell shell, string argStr, string[] args) } shell.WriteLine($"Objectives for player {player.UserId}:"); - var objectives = mind.AllObjectives.ToList(); + var objectives = mind.Objectives.ToList(); if (objectives.Count == 0) { shell.WriteLine("None."); diff --git a/Content.Server/Objectives/Systems/HelpProgressConditionSystem.cs b/Content.Server/Objectives/Systems/HelpProgressConditionSystem.cs index e4455c03813632..e0a56149b3e252 100644 --- a/Content.Server/Objectives/Systems/HelpProgressConditionSystem.cs +++ b/Content.Server/Objectives/Systems/HelpProgressConditionSystem.cs @@ -59,7 +59,7 @@ private void OnTraitorAssigned(EntityUid uid, RandomTraitorProgressComponent com if (!TryComp(traitor, out var mind)) continue; - foreach (var objective in mind.AllObjectives) + foreach (var objective in mind.Objectives) { if (HasComp(objective)) removeList.Add(traitor); @@ -88,7 +88,7 @@ private float GetProgress(EntityUid target) if (TryComp(target, out var mind)) { - foreach (var objective in mind.AllObjectives) + foreach (var objective in mind.Objectives) { // this has the potential to loop forever, anything setting target has to check that there is no HelpProgressCondition. var info = _objectives.GetInfo(objective, target, mind); diff --git a/Content.Server/Objectives/Systems/ObjectiveBlacklistRequirementSystem.cs b/Content.Server/Objectives/Systems/ObjectiveBlacklistRequirementSystem.cs index 8fe7e7e203150e..0671c6b67e4949 100644 --- a/Content.Server/Objectives/Systems/ObjectiveBlacklistRequirementSystem.cs +++ b/Content.Server/Objectives/Systems/ObjectiveBlacklistRequirementSystem.cs @@ -23,7 +23,7 @@ private void OnCheck(EntityUid uid, ObjectiveBlacklistRequirementComponent comp, if (args.Cancelled) return; - foreach (var objective in args.Mind.AllObjectives) + foreach (var objective in args.Mind.Objectives) { if (_whitelistSystem.IsBlacklistPass(comp.Blacklist, objective)) { diff --git a/Content.Shared/Mind/SharedMindSystem.cs b/Content.Shared/Mind/SharedMindSystem.cs index bf1065c1b1d6f1..ba365daf15cfe6 100644 --- a/Content.Shared/Mind/SharedMindSystem.cs +++ b/Content.Shared/Mind/SharedMindSystem.cs @@ -370,7 +370,7 @@ public bool TryGetObjectiveComp(EntityUid mindId, [NotNullWhen(true)] out T? if (Resolve(mindId, ref mind)) { var query = GetEntityQuery(); - foreach (var uid in mind.AllObjectives) + foreach (var uid in mind.Objectives) { if (query.TryGetComponent(uid, out objective)) {