Class GiveSwordAction
This action gives a sword to another agent.
Inheritance
GiveSwordAction
Assembly: UtilityAIFramework.dll
Syntax
public class GiveSwordAction : UtilityAction, IUtilityAction
Fields
HeroAgent
Declaration
Field Value
Properties
HeroAgentContext
Declaration
public ExampleDataContext HeroAgentContext { get; }
Property Value
Methods
IsAvailable()
In this case, we override IsAvailable because we don't want to give a weapon to the agent if he already has one.
Other alternative is we actually deduct the number of swords this agent carries and use it in Consideration.
But this is simple and illustrate a usage for IsAvailable that is easy to read.
Declaration
public override bool IsAvailable()
Returns
Overrides
OnMove(MoveSystemBase)
Declaration
public override void OnMove(MoveSystemBase moveSystem)
Parameters
Overrides
Declaration
public override EActionStatus Perform(Agent agent)
Parameters
Type |
Name |
Description |
Agent |
agent |
|
Returns
Overrides
Implements