Skip to content

Commit

Permalink
Remove uses of AllObjectives (space-wizards#30077)
Browse files Browse the repository at this point in the history
Remove the uses of AllObjectives
  • Loading branch information
Cojoke-dot authored Jul 16, 2024
1 parent 911a94d commit 927cf77
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Content.Server/CharacterInfo/CharacterInfoSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions Content.Server/Dragon/DragonSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ public void DeleteRifts(EntityUid uid, bool resetRole, DragonComponent? comp = n
return;

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))
{
Expand All @@ -247,7 +247,7 @@ public void RiftCharged(EntityUid uid, DragonComponent? comp = null)
return;

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))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ private void OnTraitorAssigned(EntityUid uid, RandomTraitorProgressComponent com
if (!TryComp<MindComponent>(traitor, out var mind))
continue;

foreach (var objective in mind.AllObjectives)
foreach (var objective in mind.Objectives)
{
if (HasComp<HelpProgressConditionComponent>(objective))
removeList.Add(traitor);
Expand Down Expand Up @@ -88,7 +88,7 @@ private float GetProgress(EntityUid target)

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.
var info = _objectives.GetInfo(objective, target, mind);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))
{
Expand Down
2 changes: 1 addition & 1 deletion Content.Shared/Mind/SharedMindSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ public bool TryGetObjectiveComp<T>(EntityUid mindId, [NotNullWhen(true)] out T?
if (Resolve(mindId, ref mind))
{
var query = GetEntityQuery<T>();
foreach (var uid in mind.AllObjectives)
foreach (var uid in mind.Objectives)
{
if (query.TryGetComponent(uid, out objective))
{
Expand Down

0 comments on commit 927cf77

Please sign in to comment.