Class ActionsBuilder
Fluent builder for Kingmaker.ElementsSystem.ActionList.
Inheritance
Namespace: BlueprintCore.Actions.Builder
Assembly: BlueprintCore.dll
Syntax
public class ActionsBuilder
Remarks
Actions are supported using extension methods. Include the extension namespaces as needed.
When Build is called the Kingmaker.ElementsSystem.ActionList is constructed, validated, and returned. If any errors are detected by Validator they will be logged as a warning.
Do not call Build(Validator) twice on the same builder.
If a method calls for a string to represent any type of blueprint, you can pass the blueprint's Kingmaker.Blueprints.SimpleBlueprint.AssetGuid as a string or as a name you already provided using AddGuidsByName().
AreaEx | Actions involving the game map, dungeons, or locations. See also KingdomEx for location related actions specifically tied to the Kingdom and Crusade system. |
AVEx | Actions involving audiovisual effects such as dialogs, camera, cutscenes, and sounds. |
BasicEx | Most game mechanics related actions not included in ContextEx. |
ContextEx | Most Kingmaker.UnitLogic.Mechanics.Actions.ContextAction types. Some Kingmaker.UnitLogic.Mechanics.Actions.ContextAction types are in more specific extensions such as AVEx or KingdomEx. |
KingdomEx | Actions involving the Kingdom and Crusade system. |
MiscEx | Actions without a better extension container such as achievements and CustomEvent. |
Actions defined in BlueprintCore and not available in the base game. | |
StoryEx | Actions related to the story such as companion stories, quests, name changes, and etudes. |
UpgraderEx | All UpgraderOnlyActions. |
// Provides ApplyBuff and MeleeAttack extensions
using BlueprintCore.Actions.Builder.ContextEx;
var actionList =
ActionsBuilder.New()
.ApplyBuff(MyAttackBuff, duration: ContextDuration.Fixed(1))
.MeleeAttack()
.Build();
Methods
| Improve this Doc View SourceAdd(GameAction)
Adds the specified Kingmaker.ElementsSystem.GameAction to the list, with validation.
Declaration
public ActionsBuilder Add(GameAction action)
Parameters
Type | Name | Description |
---|---|---|
Kingmaker.ElementsSystem.GameAction | action |
Returns
Type | Description |
---|---|
ActionsBuilder |
Remarks
It is recommended to only call this from an extension class or when adding an action type not supported by the builder.
Add<A>(Action<A>)
Adds a Kingmaker.ElementsSystem.GameAction of the specified type to the list.
Declaration
public ActionsBuilder Add<A>(Action<A> init = null)
where A : GameAction, new()
Parameters
Type | Name | Description |
---|---|---|
System.Action<A> | init | Optional initialization System.Action run on the action. |
Returns
Type | Description |
---|---|
ActionsBuilder |
Type Parameters
Name | Description |
---|---|
A |
Remarks
It is recommended to only call this when adding an action type not supported by the builder.
AddAll(ActionList, Func<GameAction, Boolean>)
Adds all actions from actionList
. This is a shallow copy so changes to those actions affect
the original list as well.
Declaration
public ActionsBuilder AddAll(ActionList actionList, Func<GameAction, bool> matcher)
Parameters
Type | Name | Description |
---|---|---|
Kingmaker.ElementsSystem.ActionList | actionList | |
System.Func<Kingmaker.ElementsSystem.GameAction, System.Boolean> | matcher | Only actions matching this function are added |
Returns
Type | Description |
---|---|
ActionsBuilder |
AddAll(ActionList, Type[])
Adds all actions from actionList
. This is a shallow copy so changes to those actions affect
the original list as well.
Declaration
public ActionsBuilder AddAll(ActionList actionList, params Type[] typesToExclude)
Parameters
Type | Name | Description |
---|---|---|
Kingmaker.ElementsSystem.ActionList | actionList | |
System.Type[] | typesToExclude | Types of actions which will not be added |
Returns
Type | Description |
---|---|
ActionsBuilder |
Build(Validator)
Declaration
public ActionList Build(Validator parentValidator = null)
Parameters
Type | Name | Description |
---|---|---|
Validator | parentValidator | If specified, indicates that errors should be reported to this validator. As a result errors will not be logged by this call but can be logged using the provided validator. |
Returns
Type | Description |
---|---|
Kingmaker.ElementsSystem.ActionList | An Kingmaker.ElementsSystem.ActionList containing all specified actions. Any validation errors are logged as a warning. Do not call twice on the same builder. |
Conditional(ConditionsBuilder, ActionsBuilder, ActionsBuilder)
Adds Kingmaker.Designers.EventConditionActionSystem.Actions.Conditional
Declaration
public ActionsBuilder Conditional(ConditionsBuilder conditions, ActionsBuilder ifTrue = null, ActionsBuilder ifFalse = null)
Parameters
Type | Name | Description |
---|---|---|
ConditionsBuilder | conditions | |
ActionsBuilder | ifTrue | |
ActionsBuilder | ifFalse |
Returns
Type | Description |
---|---|
ActionsBuilder |
New()
Declaration
public static ActionsBuilder New()
Returns
Type | Description |
---|---|
ActionsBuilder | A new ActionsBuilder |
Operators
| Improve this Doc View SourceImplicit(ActionList to ActionsBuilder)
Declaration
public static implicit operator ActionsBuilder(ActionList actionList)
Parameters
Type | Name | Description |
---|---|---|
Kingmaker.ElementsSystem.ActionList | actionList |
Returns
Type | Description |
---|---|
ActionsBuilder |