WornClothes - Ellpeck/TinyLifeExampleMod Wiki

Tiny Life

TinyLife.Objects

WornClothes Class

WornClothes is a wrapper around Clothes that additionally stores the colors and whether or not the clothes are from the ClothesStorage or not

public class WornClothes

Inheritance System.Object 🡒 WornClothes

Constructors

WornClothes.WornClothes(Clothes, int[]) Constructor

Creates a new worn Clothes instance with the given settings

public WornClothes(TinyLife.Objects.Clothes type, int[] colors);

Parameters

type Clothes
The Clothes type

colors System.Int32[]
The indices of the colors that this instance should have

Fields

WornClothes.Colors Field

The colors of this Clothes instance.
Each index references the color of the underlying Type's Colors.
The actual color can be retrieved easily using GetColor(int).

public int[] Colors;

Field Value

System.Int32[]

WornClothes.FromStorage Field

This value is true if this clothes item is from the ClothesStorage

public bool FromStorage;

Field Value

System.Boolean

WornClothes.Type Field

The Clothes type that these worn clothes reference

public readonly Clothes Type;

Field Value

Clothes

Methods

WornClothes.GetColor(int) Method

Returns the Microsoft.Xna.Framework.Color of the given layer

public Microsoft.Xna.Framework.Color GetColor(int layer);

Parameters

layer System.Int32
The layer to query the color for

Returns

Microsoft.Xna.Framework.Color
The color that the layer has, based on Colors

WornClothes.Validate() Method

This method is called when this object is loaded from disk.

public bool Validate();

Returns

System.Boolean
false if the object is not valid, true otherwise