Table of Contents

Class ClothingItemDefinitionBuilder

Namespace
S1API.Items.Clothing
Assembly
S1API.dll

Builder for composing clothing item definitions at runtime. Use fluent methods to configure clothing properties before calling Build().

public class ClothingItemDefinitionBuilder : StorableItemDefinitionBuilderBase<ClothingItemDefinitionBuilder>
Inheritance
ClothingItemDefinitionBuilder
Inherited Members
Extension Methods

Methods

Build()

Builds the item definition, registers it with the game's registry, and returns a wrapper.

public ClothingItemDefinition Build()

Returns

ClothingItemDefinition

A wrapper around the created clothing item definition.

CopyPropertiesFrom(StorableItemDefinition)

Copies all properties from a source definition to the current definition.

protected override void CopyPropertiesFrom(StorableItemDefinition source)

Parameters

source StorableItemDefinition

The source definition to copy from.

CreateWrapper(StorableItemDefinition)

Creates a wrapper around the given item definition. Subclasses can override this to return a more specific wrapper type.

protected override StorableItemDefinition CreateWrapper(StorableItemDefinition definition)

Parameters

definition StorableItemDefinition

The item definition to wrap.

Returns

StorableItemDefinition

A wrapper around the given item definition.

WithApplicationType(ClothingApplicationType)

Sets how this clothing item is applied to the avatar.

public ClothingItemDefinitionBuilder WithApplicationType(ClothingApplicationType applicationType)

Parameters

applicationType ClothingApplicationType

The application type.

Returns

ClothingItemDefinitionBuilder

The builder instance for fluent chaining.

WithBlockedSlots(params ClothingSlot[])

Sets the list of clothing slots this item blocks when equipped.

public ClothingItemDefinitionBuilder WithBlockedSlots(params ClothingSlot[] slots)

Parameters

slots ClothingSlot[]

Array of slots to block.

Returns

ClothingItemDefinitionBuilder

The builder instance for fluent chaining.

WithClothingAsset(string)

Sets the asset path to the clothing prefab or layer.

public ClothingItemDefinitionBuilder WithClothingAsset(string assetPath)

Parameters

assetPath string

Resources path to the clothing asset.

Returns

ClothingItemDefinitionBuilder

The builder instance for fluent chaining.

WithColorable(bool)

Sets whether this clothing item can be colored.

public ClothingItemDefinitionBuilder WithColorable(bool colorable)

Parameters

colorable bool

True if colorable, false otherwise.

Returns

ClothingItemDefinitionBuilder

The builder instance for fluent chaining.

WithDefaultColor(ClothingColor)

Sets the default color for this clothing item.

public ClothingItemDefinitionBuilder WithDefaultColor(ClothingColor color)

Parameters

color ClothingColor

The default color.

Returns

ClothingItemDefinitionBuilder

The builder instance for fluent chaining.

WithSlot(ClothingSlot)

Sets the clothing slot this item occupies.

public ClothingItemDefinitionBuilder WithSlot(ClothingSlot slot)

Parameters

slot ClothingSlot

The clothing slot.

Returns

ClothingItemDefinitionBuilder

The builder instance for fluent chaining.