Class ChangeOutfitIntentionAction
An action that causes a person to change their current outfit to one that matches the given ClothesIntention. To construct instances of this action for various use cases, see Enqueue(PersonLike, ClothesIntention, bool) and Construct(PersonLike, ClothesIntention). This method can generally be combined with TakeOffClothesAction.
public class ChangeOutfitIntentionAction : Action, IGenericDataHolder
- Inheritance
-
JsonTypeSafeGenericDataHolderChangeOutfitIntentionAction
- Implements
-
IGenericDataHolder
- Inherited Members
-
JsonTypeSafeGenericDataHolder.GetDataKeys()
- Extension Methods
Constructors
ChangeOutfitIntentionAction(ActionType, ActionInfo, ClothesIntention)
public ChangeOutfitIntentionAction(ActionType type, ActionInfo info, ClothesIntention intention = ClothesIntention.Everyday)
Parameters
typeActionTypeinfoActionInfointentionClothesIntention
Methods
CanGenericInterrupt(bool)
Determines whether this action can be interrupted by a generic interruption source. If this method returns true, it is usually followed by a call to Interrupt(CompletionType). To call this method effectively, use GenericInterruptAction(Action, bool, CompletionType, bool). This method returns true by default.
public override bool CanGenericInterrupt(bool isPlayer)
Parameters
isPlayerboolWhether the generic interruption source is the player.
Returns
- bool
Whether a generic interruption source can interrupt this action.
Construct(PersonLike, ClothesIntention)
Constructs a new instance of the ChangeOutfitIntentionAction with the given settings and returns it. An action is only constructed and returned if the given person can currently change into the given intention, and is not already wearing a matching outfit.
public static ChangeOutfitIntentionAction Construct(PersonLike person, ClothesIntention intention)
Parameters
personPersonLikeThe person to change.
intentionClothesIntentionThe intention to change into.
Returns
- ChangeOutfitIntentionAction
A ChangeOutfitIntentionAction if changing is required, null otherwise.
Enqueue(PersonLike, ClothesIntention, bool)
Enqueues a new instance of the ChangeOutfitIntentionAction with the given settings. An action is only enqueued if there is not already an instance of the ChangeOutfitIntentionAction with the same ClothesIntention enqueued, and if a person can currently change into the given intention, and is not already wearing a matching outfit. The method's return value determines whether an action was successfully enqueued.
public static bool Enqueue(PersonLike person, ClothesIntention intention, bool priority = false)
Parameters
personPersonLikeThe person to change.
intentionClothesIntentionThe intention to change into.
priorityboolWhether the change action should be enqueued as priority, ie. at the start of the action queue.
Returns
- bool
Whether the action was successfully enqueued.
GetDisplayName()
Returns a localized string that explains this action in short. By default, this method returns GetDisplayName(ActionInfo, bool).
public override string GetDisplayName()
Returns
- string
This action's display name
Update(GameTime, TimeSpan, float)
This method is called every update frame if this action is currently active. By default, only the ElapsedTime is modified in this method and ActionUpdate(Action, GameTime, TimeSpan, float, bool) is called.
public override void Update(GameTime time, TimeSpan passedInGame, float speedMultiplier)