Table of Contents

Class BuildableItemDefinitionBuilder

Namespace
S1API.Items
Assembly
S1API.dll

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

[Obsolete("Use S1API.Items.Buildable.BuildableItemDefinitionBuilder instead")]
public sealed class BuildableItemDefinitionBuilder
Inheritance
BuildableItemDefinitionBuilder
Inherited Members
Extension Methods

Methods

Build()

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

public BuildableItemDefinition Build()

Returns

BuildableItemDefinition

A wrapper around the created buildable item definition.

WithBasicInfo(string, string, string)

Sets the basic information for the buildable item.

public BuildableItemDefinitionBuilder WithBasicInfo(string id, string name, string description)

Parameters

id string

Unique identifier for the item (e.g., "my_custom_rack").

name string

Display name shown in UI.

description string

Item description shown in tooltips.

Returns

BuildableItemDefinitionBuilder

The builder instance for fluent chaining.

WithBuildSound(BuildSoundType)

Sets the sound type played when this item is built.

public BuildableItemDefinitionBuilder WithBuildSound(BuildSoundType soundType)

Parameters

soundType BuildSoundType

The build sound type.

Returns

BuildableItemDefinitionBuilder

The builder instance for fluent chaining.

WithCategory(ItemCategory)

Sets the category for inventory organization.

public BuildableItemDefinitionBuilder WithCategory(ItemCategory category)

Parameters

category ItemCategory

The item category.

Returns

BuildableItemDefinitionBuilder

The builder instance for fluent chaining.

WithEquippable(Equippable)

Attaches an equippable component to this item, allowing it to be equipped by the player.

public BuildableItemDefinitionBuilder WithEquippable(Equippable equippable)

Parameters

equippable Equippable

The equippable wrapper to attach.

Returns

BuildableItemDefinitionBuilder

The builder instance for fluent chaining.

WithIcon(Sprite)

Sets the icon sprite displayed for this item in UI.

public BuildableItemDefinitionBuilder WithIcon(Sprite icon)

Parameters

icon Sprite

The sprite to use as the item icon.

Returns

BuildableItemDefinitionBuilder

The builder instance for fluent chaining.

WithLegalStatus(LegalStatus)

Sets the legal status of the item.

public BuildableItemDefinitionBuilder WithLegalStatus(LegalStatus status)

Parameters

status LegalStatus

Whether the item is legal or illegal.

Returns

BuildableItemDefinitionBuilder

The builder instance for fluent chaining.

WithPricing(float, float)

Configures the economic properties of the item.

public BuildableItemDefinitionBuilder WithPricing(float basePurchasePrice, float resellMultiplier = 0.5)

Parameters

basePurchasePrice float

Base price when buying from shops.

resellMultiplier float

Fraction of purchase price recovered when selling (0.0 to 1.0).

Returns

BuildableItemDefinitionBuilder

The builder instance for fluent chaining.

WithStackLimit(int)

Sets the maximum stack size for this item.

public BuildableItemDefinitionBuilder WithStackLimit(int limit)

Parameters

limit int

Maximum quantity per inventory slot (1-999).

Returns

BuildableItemDefinitionBuilder

The builder instance for fluent chaining.