(1c6954251) Add IsLoop property. Fixes operate item orders being removed when they are done. Instead of calling loopable objectives done, let's just use the priority system.

This commit is contained in:
Joonas Rikkonen
2019-05-16 05:11:01 +03:00
parent 781fd44a8c
commit 9a1e7f8212
20 changed files with 174 additions and 65 deletions
@@ -21,7 +21,15 @@ namespace Barotrauma
protected string option;
protected bool abandon;
/// <summary>
/// Can the objective be completed. That is, does the objective have failing subobjectives or other conditions that prevent it from completing.
/// </summary>
public virtual bool CanBeCompleted => !abandon && subObjectives.All(so => so.CanBeCompleted);
/// <summary>
/// When true, the objective is never completed, unless CanBeCompleted returns false.
/// </summary>
public virtual bool IsLoop { get; set; }
public IEnumerable<AIObjective> SubObjectives => subObjectives;
public AIObjective CurrentSubObjective { get; private set; }