Remove uses of AllObjectives (#30077)

Remove the uses of AllObjectives
This commit is contained in:
Cojoke
2024-07-16 02:17:18 -05:00
committed by GitHub
parent 911a94dba9
commit 927cf7799f
6 changed files with 8 additions and 8 deletions

View File

@@ -36,7 +36,7 @@ public sealed class CharacterInfoSystem : EntitySystem
if (_minds.TryGetMind(entity, out var mindId, out var mind)) if (_minds.TryGetMind(entity, out var mindId, out var mind))
{ {
// Get objectives // Get objectives
foreach (var objective in mind.AllObjectives) foreach (var objective in mind.Objectives)
{ {
var info = _objectives.GetInfo(objective, mindId, mind); var info = _objectives.GetInfo(objective, mindId, mind);
if (info == null) if (info == null)

View File

@@ -225,7 +225,7 @@ public sealed partial class DragonSystem : EntitySystem
return; return;
var mind = Comp<MindComponent>(mindContainer.Mind.Value); var mind = Comp<MindComponent>(mindContainer.Mind.Value);
foreach (var objId in mind.AllObjectives) foreach (var objId in mind.Objectives)
{ {
if (_objQuery.TryGetComponent(objId, out var obj)) if (_objQuery.TryGetComponent(objId, out var obj))
{ {
@@ -247,7 +247,7 @@ public sealed partial class DragonSystem : EntitySystem
return; return;
var mind = Comp<MindComponent>(mindContainer.Mind.Value); var mind = Comp<MindComponent>(mindContainer.Mind.Value);
foreach (var objId in mind.AllObjectives) foreach (var objId in mind.Objectives)
{ {
if (_objQuery.TryGetComponent(objId, out var obj)) if (_objQuery.TryGetComponent(objId, out var obj))
{ {

View File

@@ -33,7 +33,7 @@ namespace Content.Server.Objectives.Commands
} }
shell.WriteLine($"Objectives for player {player.UserId}:"); shell.WriteLine($"Objectives for player {player.UserId}:");
var objectives = mind.AllObjectives.ToList(); var objectives = mind.Objectives.ToList();
if (objectives.Count == 0) if (objectives.Count == 0)
{ {
shell.WriteLine("None."); shell.WriteLine("None.");

View File

@@ -59,7 +59,7 @@ public sealed class HelpProgressConditionSystem : EntitySystem
if (!TryComp<MindComponent>(traitor, out var mind)) if (!TryComp<MindComponent>(traitor, out var mind))
continue; continue;
foreach (var objective in mind.AllObjectives) foreach (var objective in mind.Objectives)
{ {
if (HasComp<HelpProgressConditionComponent>(objective)) if (HasComp<HelpProgressConditionComponent>(objective))
removeList.Add(traitor); removeList.Add(traitor);
@@ -88,7 +88,7 @@ public sealed class HelpProgressConditionSystem : EntitySystem
if (TryComp<MindComponent>(target, out var mind)) if (TryComp<MindComponent>(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. // 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); var info = _objectives.GetInfo(objective, target, mind);

View File

@@ -23,7 +23,7 @@ public sealed class ObjectiveBlacklistRequirementSystem : EntitySystem
if (args.Cancelled) if (args.Cancelled)
return; return;
foreach (var objective in args.Mind.AllObjectives) foreach (var objective in args.Mind.Objectives)
{ {
if (_whitelistSystem.IsBlacklistPass(comp.Blacklist, objective)) if (_whitelistSystem.IsBlacklistPass(comp.Blacklist, objective))
{ {

View File

@@ -370,7 +370,7 @@ public abstract class SharedMindSystem : EntitySystem
if (Resolve(mindId, ref mind)) if (Resolve(mindId, ref mind))
{ {
var query = GetEntityQuery<T>(); var query = GetEntityQuery<T>();
foreach (var uid in mind.AllObjectives) foreach (var uid in mind.Objectives)
{ {
if (query.TryGetComponent(uid, out objective)) if (query.TryGetComponent(uid, out objective))
{ {