mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-10 19:01:13 +03:00
24 lines
706 B
C#
24 lines
706 B
C#
using Content.Server.Objectives.Interfaces;
|
|
|
|
namespace Content.Server.Objectives.Requirements
|
|
{
|
|
[DataDefinition]
|
|
public sealed class IncompatibleObjectivesRequirement : IObjectiveRequirement
|
|
{
|
|
[DataField("objectives")]
|
|
private readonly List<string> _incompatibleObjectives = new();
|
|
|
|
public bool CanBeAssigned(Mind.Mind mind)
|
|
{
|
|
foreach (var objective in mind.AllObjectives)
|
|
{
|
|
foreach (var incompatibleObjective in _incompatibleObjectives)
|
|
{
|
|
if (incompatibleObjective == objective.Prototype.ID) return false;
|
|
}
|
|
}
|
|
|
|
return true;
|
|
}
|
|
}
|
|
}
|