(ac7ab10b0) Pass AIObjectiveManager reference in the constructors instead of methods so that we can always access it.

This commit is contained in:
Joonas Rikkonen
2019-05-16 05:14:20 +03:00
parent bec7aadfa9
commit 2ae54a01a5
40 changed files with 290 additions and 322 deletions
@@ -29,7 +29,7 @@ namespace Barotrauma
private readonly List<Hull> targetHulls = new List<Hull>(20);
private readonly List<float> hullWeights = new List<float>(20);
public AIObjectiveIdle(Character character, float priorityModifier = 1) : base(character, "", priorityModifier)
public AIObjectiveIdle(Character character, AIObjectiveManager objectiveManager, float priorityModifier = 1) : base(character, objectiveManager, priorityModifier)
{
standStillTimer = Rand.Range(-10.0f, 10.0f);
walkDuration = Rand.Range(0.0f, 10.0f);
@@ -40,10 +40,8 @@ namespace Barotrauma
public override bool IsLoop { get => true; set => throw new System.Exception("Trying to set the value for IsLoop from: " + System.Environment.StackTrace); }
public override float GetPriority(AIObjectiveManager objectiveManager)
{
return 1.0f;
}
// TODO: take the initiative into account
public override float GetPriority() => 1;
protected override void Act(float deltaTime)
{