pub struct ItemTransitionDefinition<K, I, E, S> {
pub key: K,
pub name: String,
pub friendly_name: String,
pub icon_path: Option<String>,
pub input_items: Vec<(I, usize, UseMode)>,
pub stat_conditions: Vec<StatCondition<S>>,
pub stat_effectors: Vec<E>,
pub output_items: Vec<(I, usize)>,
pub on_condition_lost: ConditionLostReaction,
pub time_to_complete: f64,
pub consume_input_immediate: bool,
pub auto_trigger: bool,
}
Expand description
A transition from one or more items into one or more different items. Can be used for all sorts of crafting.
Fields§
§key: K
The id of this item transition.
name: String
The name of the transition.
friendly_name: String
The friendly name of the transition.
icon_path: Option<String>
The icon path.
input_items: Vec<(I, usize, UseMode)>
The different input items, quantities and UseMode
for each one.
stat_conditions: Vec<StatCondition<S>>
The required stats conditions required to process the transition.
stat_effectors: Vec<E>
The effectors applied during crafting.
output_items: Vec<(I, usize)>
The different output items.
on_condition_lost: ConditionLostReaction
What happens when you lose the condition required to continue the transition.
time_to_complete: f64
The time to complete the transition.
consume_input_immediate: bool
Consume the input items at the start of the transition, regardless of the result.
auto_trigger: bool
Automatically transition when all the required conditions are met.
Implementations§
Source§impl<K, I, E, S> ItemTransitionDefinition<K, I, E, S>
impl<K, I, E, S> ItemTransitionDefinition<K, I, E, S>
Sourcepub fn new(
key: K,
name: String,
friendly_name: String,
icon_path: Option<String>,
input_items: Vec<(I, usize, UseMode)>,
stat_conditions: Vec<StatCondition<S>>,
stat_effectors: Vec<E>,
output_items: Vec<(I, usize)>,
on_condition_lost: ConditionLostReaction,
time_to_complete: f64,
consume_input_immediate: bool,
auto_trigger: bool,
) -> Self
pub fn new( key: K, name: String, friendly_name: String, icon_path: Option<String>, input_items: Vec<(I, usize, UseMode)>, stat_conditions: Vec<StatCondition<S>>, stat_effectors: Vec<E>, output_items: Vec<(I, usize)>, on_condition_lost: ConditionLostReaction, time_to_complete: f64, consume_input_immediate: bool, auto_trigger: bool, ) -> Self
Constructs a new ItemTransitionDefinition
.
Trait Implementations§
Source§impl<K: Clone, I: Clone, E: Clone, S: Clone> Clone for ItemTransitionDefinition<K, I, E, S>
impl<K: Clone, I: Clone, E: Clone, S: Clone> Clone for ItemTransitionDefinition<K, I, E, S>
Source§fn clone(&self) -> ItemTransitionDefinition<K, I, E, S>
fn clone(&self) -> ItemTransitionDefinition<K, I, E, S>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<'de, K, I, E, S> Deserialize<'de> for ItemTransitionDefinition<K, I, E, S>
impl<'de, K, I, E, S> Deserialize<'de> for ItemTransitionDefinition<K, I, E, S>
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<K, I, E, S> Serialize for ItemTransitionDefinition<K, I, E, S>
impl<K, I, E, S> Serialize for ItemTransitionDefinition<K, I, E, S>
Auto Trait Implementations§
impl<K, I, E, S> Freeze for ItemTransitionDefinition<K, I, E, S>where
K: Freeze,
impl<K, I, E, S> RefUnwindSafe for ItemTransitionDefinition<K, I, E, S>
impl<K, I, E, S> Send for ItemTransitionDefinition<K, I, E, S>
impl<K, I, E, S> Sync for ItemTransitionDefinition<K, I, E, S>
impl<K, I, E, S> Unpin for ItemTransitionDefinition<K, I, E, S>
impl<K, I, E, S> UnwindSafe for ItemTransitionDefinition<K, I, E, S>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more