Skip to main content

vitium_api/game/components/
container.rs

1use bevy_ecs::component::Component;
2use serde::{Deserialize, Serialize};
3
4use crate::UId;
5
6/// Containers.
7#[derive(Clone, Serialize, Deserialize, Component)]
8#[cfg_attr(target_family = "wasm", derive(tsify_next::Tsify))]
9#[cfg_attr(
10    target_family = "wasm",
11    tsify(into_wasm_abi, from_wasm_abi, large_number_types_as_bigints)
12)]
13pub struct Container {
14    /// Time to store an item.
15    pub time_cost: i32,
16    /// In milimetres.
17    pub length: i32,
18    /// In mililitres.
19    pub volume: i32,
20    /// In grams.
21    pub weight: i32,
22    /// If the container is waterproof.
23    pub waterproof: bool,
24    pub content: Vec<UId>,
25}