Vixen
caa30e12
csharp
public readonly record struct AgentContext

Everything an action is given: which agent, in which world, with which data.

Read the guide page for this →

Remarks

A struct passed by in, so building one per agent per tick costs nothing and nothing is tempted to keep one. It holds no per-action state of any kind; that is the Span<byte>'s job, for the reason IAgentAction gives.

Fields and properties (10)

  • public World World

    The world the agent lives in.

  • public Entity Entity

    The agent.

  • public Blackboard Blackboard

    Its own data. One agent owns one board.

  • public SharedBlackboard? Shared

    The board its group shares, if it is in one.

  • public GameTime Time

    The frame's clock. DeltaSeconds is the frame's step, which is not the action's — see IAgentAction.Tick.

  • public uint Seed

    The agent's own random stream. Keyed on the agent rather than on its slot, so that a replay of the same tick makes the same choice — see AgentRandom.

  • public AgentActionRegistry? Actions

    Every action this agent's assets may name. Present when a planner is running the action, and null when a caller ticked one directly.

  • public AgentDebugRecorder? Debug

    Where a node narrates itself, when anything is listening.

  • public BehaviorTreeInstance? RunningTree

    The behaviour tree this action is a task of, if one is running it.

  • public int RunningNode

    Which node of that tree it is.

Methods (2)

Used by (155, showing 40)

  • AgentRandomTestsVixen.Ai.Tests
  • AgentTargetVixen.Ai.Nodes
  • AiDebugChannelTestsVixen.Ai.Tests
  • AiDiagnosisExitCriteriaTestsVixen.Ai.Tests
  • AiSnapshotTestsVixen.Ai.Tests
  • AiSnapshotsVixen.Ai
  • AiSystemVixen.Ai
  • AlwaysFailsVixen.Ai.Tests
  • AlwaysRunsVixen.Ai.Tests
  • BehaviorContextVixen.Ai
  • BehaviorTreeAbortOrderingTestsVixen.Ai.Tests
  • BehaviorTreeAbortTestsVixen.Ai.Tests
  • BehaviorTreeCostTestsVixen.Ai.Tests
  • BehaviorTreeInstanceVixen.Ai
  • BehaviorTreeServiceTestsVixen.Ai.Tests
  • BlackboardUtilityInputVixen.Ai
  • BlackboardWorldSourceVixen.Ai
  • BoardVixen.Ai.Nodes.Tests
  • BucketedSelectorVixen.Ai
  • CandidateScoringVixen.Ai
  • ClearBlackboardValueTaskVixen.Ai
  • CompositeGeneratorVixen.Ai
  • ConeGeneratorVixen.Ai
  • ConstantTargetSensorVixen.Ai
  • ConstantUtilityInputVixen.Ai
  • ConstantWorldSensorVixen.Ai
  • ConstantWorldSourceVixen.Ai
  • CountingVixen.Ai.Tests
  • CountingActionVixen.Ai.Tests
  • CountingSensorVixen.Ai.Tests
  • CurrentLocationGeneratorVixen.Ai
  • DefaultFocusServiceVixen.Ai.Nodes
  • DelegateAgentTargetSensorVixen.Ai
  • DelegateQueryTestVixen.Ai
  • DelegateTargetSensorVixen.Ai
  • DelegateUtilityInputVixen.Ai
  • DelegateWorldSensorVixen.Ai
  • DelegateWorldSourceVixen.Ai
  • DistanceQueryTestVixen.Ai
  • DistanceSensorVixen.Ai.Nodes