Keep orbit task targets on typed keys
This commit is contained in:
parent
65456f09cd
commit
cfc1ddac6d
8 changed files with 137 additions and 10 deletions
|
|
@ -3,13 +3,13 @@ using System;
|
|||
public class PatrolOrbitsTask : AgentTask
|
||||
{
|
||||
public override TaskType Type => TaskType.Defend;
|
||||
public Guid[] Circuit;
|
||||
public string[] Circuit = Array.Empty<string>();
|
||||
}
|
||||
|
||||
public class PatrolOrbitsState : BaseState
|
||||
{
|
||||
public PatrolOrbitsTask Task;
|
||||
public Guid CurrentTarget
|
||||
public string CurrentTarget
|
||||
{
|
||||
get => Task.Circuit[_currentTargetIndex];
|
||||
}
|
||||
|
|
@ -25,7 +25,7 @@ public class PatrolOrbitsState : BaseState
|
|||
var patrolMoveState = new MoveToOrbitState(agent);
|
||||
Transitions.Add(new StateTransition(patrolMoveState,
|
||||
() => true,
|
||||
() => patrolMoveState.Orbit = CurrentTarget));
|
||||
() => patrolMoveState.OrbitKey = CurrentTarget));
|
||||
patrolMoveState.Transitions.Add(new StateTransition(this, () => patrolMoveState.Distance < 10, NextTarget));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ public class StationTowing : AgentTask
|
|||
|
||||
public OrbitalEntity Station;
|
||||
|
||||
public Guid OrbitParent;
|
||||
public string OrbitParentKey = "";
|
||||
|
||||
public float OrbitDistance;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue