Class Outfit
An outfit is a set of WornClothes items for each clothes layer of a PersonLike. This class is used by Outfits and, as a result, CurrentOutfit.
[DataContract]
public class Outfit
- Inheritance
-
Outfit
- Inherited Members
- Extension Methods
Constructors
Outfit(Dictionary<ClothesLayer, WornClothes>)
Creates a new outfit with the given settings.
public Outfit(Dictionary<ClothesLayer, WornClothes> clothes = null)
Parameters
clothesDictionary<ClothesLayer, WornClothes>The clothes that this outfit contains, or null to create a new empty Dictionary<TKey, TValue>.
Fields
Clothes
A dictionary that matches a given ClothesLayer to the WornClothes that a person is wearing on that layer. If a layer is not contained in this dictionary, it means that no clothes are being worn on that layer.
[DataMember]
public readonly Dictionary<ClothesLayer, WornClothes> Clothes
Field Value
Intentions
The ClothesIntention flags that the player has set for this outfit. This intention always contains Everyday if this outfit is the first entry in Outfits.
[DataMember]
public ClothesIntention Intentions
Field Value
Name
The name of this outfit, which is used in the UI to identify it. If unset or empty, the name will be generated automatically based on this outfit's index in the Outfits collection.
[DataMember]
public string Name
Field Value
Methods
CanTakeOff(PersonLike, ClothesLayer)
Returns whether the given ClothesLayer can be taken off in the character creator by the given person.
Unlike CanTakeOff(ClothesLayer), this method also takes multi-layer clothing items into account.
public bool CanTakeOff(PersonLike person, ClothesLayer layer)
Parameters
personPersonLikeThe person.
layerClothesLayerThe clothes layer
Returns
- bool
Whether the clothes layer can be taken off
EnsureIntentionsMatch(int)
Ensures that the Intentions of this outfit match the required percentages for each layer using GetRequiredMatchPercentage(ClothesIntention).
Additionally, if outfitIndex is 0, Everyday is added to Intentions.
public void EnsureIntentionsMatch(int outfitIndex)
Parameters
GetIntentionPercentage(ClothesIntention)
Returns a value between 0 and 1 that represents how well this outfit matches the given ClothesIntention.
public float GetIntentionPercentage(ClothesIntention intention)
Parameters
intentionClothesIntentionThe intention to match the outfit to.
Returns
- float
The intention match percentage, between 0 and 1.
GetMostFittingStyle()
Returns the StylePreference that, heuristically, most fits with this outfit. The style preference is calculated based on the StylePreference of the included clothing items, and used when randomly generating additional outfits for a Tiny.
public StylePreference GetMostFittingStyle()
Returns
- StylePreference
The most fitting style preference for this outfit.
SetRandomClothesItem(Random, PersonLike, ClothesLayer, ClothesIntention, StylePreference?, bool, int, Func<Clothes, bool>, bool)
Sets a random clothes item for this outfit's given ClothesLayer.
public void SetRandomClothesItem(Random random, PersonLike person, ClothesLayer layer, ClothesIntention allowedIntentions = ClothesIntention.None, StylePreference? preferredStyle = null, bool keepOldColors = false, int maxPrice = 50, Func<Clothes, bool> additionalConditions = null, bool modifyMoney = false)
Parameters
randomRandomThe random to use.
personPersonLikeThe person.
layerClothesLayerThe layer to set the clothes item for.
allowedIntentionsClothesIntentionThe intentions allowed, or None to allow all intentions.
preferredStyleStylePreference?The preferred style to use, which will influence the chosen clothing item based on its StylePreference. If this is null, all clothing items are considered equally.
keepOldColorsboolWhether old colors should be kept if the new object's ColorScheme matches the old one.
maxPriceintThe maximum price that should be used when setting a random clothes item. Defaults to ReferencePrice.
additionalConditionsFunc<Clothes, bool>An optional set of additional conditions to check for when selecting clothing items.
modifyMoneyboolWhether adding new clothes item, or removing the current clothes item, should deduct and increase the
person's Money.