Skip to main content

vitium_api/game/components/
edible.rs

1use serde::{Deserialize, Serialize};
2
3/// Edible item.
4#[derive(Clone, Serialize, Deserialize)]
5#[cfg_attr(target_family = "wasm", derive(tsify_next::Tsify))]
6#[cfg_attr(
7    target_family = "wasm",
8    tsify(into_wasm_abi, from_wasm_abi, large_number_types_as_bigints)
9)]
10pub struct Edible {
11    /// Whether the food tasts good, in [-100,100].
12    pub taste: i8,
13    /// How much energy the food can provide, in Joules.
14    pub energy: i32,
15    /// Whether the food has been processed and purified.
16    pub purified: bool,
17}