Class TransitionableProperties
- Namespace
- Vintagestory.API.Common
- Assembly
- VintagestoryAPI.dll
This is a versatile way of allowing a collectible to change to another after a certain time in the inventory.
public class TransitionableProperties
- Inheritance
-
TransitionableProperties
- Inherited Members
- Extension Methods
Examples
"transitionablePropsByType": {
"*-long-raw": [
{
"type": "Dry",
"freshHours": { "avg": 0 },
"transitionHours": { "avg": 168 },
"transitionedStack": {
"type": "item",
"code": "bowstave-long-dry"
},
"transitionRatio": 1
}
]
},
"transitionableProps": [
{
"type": "Perish",
"freshHours": { "avg": 120 },
"transitionHours": { "avg": 24 },
"transitionedStack": {
"type": "item",
"code": "rot"
},
"transitionRatio": 0.5
}
],
Fields
FreshHours
The amount of hours before this item starts the transitioning process.
public NatFloat FreshHours
Field Value
TransitionHours
The amount of hours it takes for the item to transition, after FreshHours has elapsed.
public NatFloat TransitionHours
Field Value
TransitionRatio
Conversion ratio of fresh stacksize to transitioned stack size
public float TransitionRatio
Field Value
TransitionedStack
The itemstack the collectible turns into upon transitioning.
public JsonItemStack TransitionedStack
Field Value
Type
What kind of transition can it make?
public EnumTransitionType Type
Field Value
Methods
Clone()
Duplicates the properties, which includes cloning the stack that was eaten.
public TransitionableProperties Clone()
Returns
FromBytes(BinaryReader, IClassRegistryAPI)
public void FromBytes(BinaryReader reader, IClassRegistryAPI instancer)
Parameters
reader
BinaryReaderinstancer
IClassRegistryAPI
ToBytes(BinaryWriter)
public void ToBytes(BinaryWriter writer)
Parameters
writer
BinaryWriter