public readonly record struct AgentContextEverything an action is given: which agent, in which world, with which data.
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 WorldThe world the agent lives in.
public Entity EntityThe agent.
public Blackboard BlackboardIts own data. One agent owns one board.
public SharedBlackboard? SharedThe board its group shares, if it is in one.
public GameTime TimeThe frame's clock. DeltaSeconds is the frame's step, which is not the action's — see IAgentAction.Tick.
public uint SeedThe 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? ActionsEvery 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? DebugWhere a node narrates itself, when anything is listening.
public BehaviorTreeInstance? RunningTreeThe behaviour tree this action is a task of, if one is running it.
public int RunningNodeWhich node of that tree it is.
Methods (2)
public AgentContext(World World, Entity Entity, Blackboard Blackboard, SharedBlackboard? Shared, GameTime Time, uint Seed, AgentActionRegistry? Actions = null, AgentDebugRecorder? Debug = null, BehaviorTreeInstance? RunningTree = null, int RunningNode = -1)Everything an action is given: which agent, in which world, with which data.
public float Random(uint salt)A random number in [0,1) from this agent's stream.
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