Class Outfit
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.
Inheritance
Inherited Members
Namespace: TinyLife.Objects
Assembly: Tiny Life.dll
Syntax
[DataContract]
public class Outfit
Constructors
Outfit(Dictionary<ClothesLayer, WornClothes>)
Creates a new outfit with the given settings.
Declaration
public Outfit(Dictionary<ClothesLayer, WornClothes> clothes = null)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.Dictionary<ClothesLayer, WornClothes> | clothes | The clothes that this outfit contains, or null to create a new empty System.Collections.Generic.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.
Declaration
[DataMember]
public readonly Dictionary<ClothesLayer, WornClothes> Clothes
Field Value
Type | Description |
---|---|
System.Collections.Generic.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.
Declaration
[DataMember]
public ClothesIntention Intentions
Field Value
Type | Description |
---|---|
ClothesIntention |
Methods
EnsureIntentionsMatch(Int32)
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.
Declaration
public void EnsureIntentionsMatch(int outfitIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | outfitIndex | 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.
Declaration
public float GetIntentionPercentage(ClothesIntention intention)
Parameters
Type | Name | Description |
---|---|---|
ClothesIntention | intention | The intention to match the outfit to. |
Returns
Type | Description |
---|---|
System.Single | The intention match percentage, between 0 and 1. |
SetRandomClothesItem(Random, ClothesLayer, AgeGroup, ClothesIntention, Boolean, Int32)
Sets a random clothes item for this outfit's given ClothesLayer.
Declaration
public void SetRandomClothesItem(Random random, ClothesLayer layer, AgeGroup age, ClothesIntention allowedIntentions = ClothesIntention.None, bool keepOldColors = false, int maxPrice = 50)
Parameters
Type | Name | Description |
---|---|---|
System.Random | random | The random to use. |
ClothesLayer | layer | The layer to set the clothes item for. |
AgeGroup | age | The ages that clothes items should be generated for. |
ClothesIntention | allowedIntentions | The intentions allowed, or None to allow all intentions. |
System.Boolean | keepOldColors | Whether old colors should be kept if the new object's ColorScheme matches the old one. |
System.Int32 | maxPrice | The maximum price that should be used when setting a random clothes item. Defaults to ReferencePrice. |