Table of Contents

Class FirstOfTactic<TBeliefSet>

Namespace
Aplib.Core.Intent.Tactics
Assembly
Aplib.Core.dll

Represents a tactic that executes the first enabled action from a list of subtactics.

public class FirstOfTactic<TBeliefSet> : Tactic<TBeliefSet>, ITactic<TBeliefSet>, ILoggable, IDocumented where TBeliefSet : IBeliefSet

Type Parameters

TBeliefSet
Inheritance
Tactic<TBeliefSet>
FirstOfTactic<TBeliefSet>
Implements
ITactic<TBeliefSet>
Inherited Members

Constructors

FirstOfTactic(IMetadata, params ITactic<TBeliefSet>[])

Initializes a new instance of the FirstOfTactic<TBeliefSet> class with the specified subtactics and guard condition.

public FirstOfTactic(IMetadata metadata, params ITactic<TBeliefSet>[] subtactics)

Parameters

metadata IMetadata

Metadata about this tactic, used to quickly display the tactic in several contexts.

subtactics ITactic<TBeliefSet>[]

The list of subtactics.

FirstOfTactic(IMetadata, Predicate<TBeliefSet>, params ITactic<TBeliefSet>[])

Initializes a new instance of the FirstOfTactic<TBeliefSet> class with the specified subtactics and guard condition.

public FirstOfTactic(IMetadata metadata, Predicate<TBeliefSet> guard, params ITactic<TBeliefSet>[] subtactics)

Parameters

metadata IMetadata

Metadata about this tactic, used to quickly display the tactic in several contexts.

guard Predicate<TBeliefSet>

The guard condition.

subtactics ITactic<TBeliefSet>[]

The list of subtactics.

FirstOfTactic(params ITactic<TBeliefSet>[])

Initializes a new instance of the FirstOfTactic<TBeliefSet> class with the specified subtactics and guard condition.

public FirstOfTactic(params ITactic<TBeliefSet>[] subtactics)

Parameters

subtactics ITactic<TBeliefSet>[]

The list of subtactics.

FirstOfTactic(Predicate<TBeliefSet>, params ITactic<TBeliefSet>[])

Initializes a new instance of the FirstOfTactic<TBeliefSet> class with the specified subtactics and guard condition.

public FirstOfTactic(Predicate<TBeliefSet> guard, params ITactic<TBeliefSet>[] subtactics)

Parameters

guard Predicate<TBeliefSet>

The guard condition.

subtactics ITactic<TBeliefSet>[]

The list of subtactics.

Fields

_subtactics

Gets or sets the subtactics of the tactic.

protected readonly LinkedList<ITactic<TBeliefSet>> _subtactics

Field Value

LinkedList<ITactic<TBeliefSet>>

Methods

GetAction(TBeliefSet)

Gets the first enabled action of the tactic.

public override IAction<TBeliefSet>? GetAction(TBeliefSet beliefSet)

Parameters

beliefSet TBeliefSet

Returns

IAction<TBeliefSet>

A concrete IAction<TBeliefSet> that the tactic can perform, or null if no actions are enabled.

GetLogChildren()

Gets the children of the loggable object.

public override IEnumerable<ILoggable> GetLogChildren()

Returns

IEnumerable<ILoggable>

The children of the loggable object.