Table of Contents

Class Outfit

Namespace
TinyLife.Objects
Assembly
Tiny Life.dll

An outfit is a set of WornClothes items for each clothes layer of a Person. 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

clothes Dictionary<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

Dictionary<ClothesLayer, WornClothes>

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

ClothesIntention

Methods

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

outfitIndex int

The index that this outfit has in Outfits.

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

intention ClothesIntention

The 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, Person, ClothesLayer, ClothesIntention, StylePreference?, bool, int, Func<Clothes, bool>)

Sets a random clothes item for this outfit's given ClothesLayer.

public void SetRandomClothesItem(Random random, Person person, ClothesLayer layer, ClothesIntention allowedIntentions = ClothesIntention.None, StylePreference? preferredStyle = null, bool keepOldColors = false, int maxPrice = 50, Func<Clothes, bool> additionalConditions = null)

Parameters

random Random

The random to use.

person Person

The person.

layer ClothesLayer

The layer to set the clothes item for.

allowedIntentions ClothesIntention

The intentions allowed, or None to allow all intentions.

preferredStyle StylePreference?

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.

keepOldColors bool

Whether old colors should be kept if the new object's ColorScheme matches the old one.

maxPrice int

The maximum price that should be used when setting a random clothes item. Defaults to ReferencePrice.

additionalConditions Func<Clothes, bool>

An optional set of additional conditions to check for when selecting clothing items.