refactor(vm): freeze concreet ic, add "humans", tsify feature
This commit is contained in:
@@ -6,7 +6,9 @@ edition.workspace = true
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[features]
|
||||
prefab_database = [] # compile with the prefab database enabled
|
||||
prefab_database = [] # compile with the prefab database enabled
|
||||
tsify = ["dep:tsify", "dep:wasm-bindgen"]
|
||||
wasm-bindgen = ["dep:wasm-bindgen"]
|
||||
|
||||
[dependencies]
|
||||
num-integer = "0.1.46"
|
||||
@@ -14,3 +16,5 @@ phf = "0.11.2"
|
||||
serde = "1.0.202"
|
||||
serde_derive = "1.0.202"
|
||||
strum = { version = "0.26.2", features = ["derive", "phf", "strum_macros"] }
|
||||
tsify = { version = "0.4.5", optional = true, features = ["js"] }
|
||||
wasm-bindgen = { version = "0.2.92", optional = true }
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
use strum::{AsRefStr, Display, EnumIter, EnumProperty, EnumString, FromRepr};
|
||||
#[cfg(feature = "tsify")]
|
||||
use tsify::Tsify;
|
||||
#[cfg(feature = "tsify")]
|
||||
use wasm_bindgen::prelude::*;
|
||||
use super::script::{LogicSlotType, LogicType};
|
||||
#[derive(
|
||||
Debug,
|
||||
@@ -19,6 +23,8 @@ use super::script::{LogicSlotType, LogicType};
|
||||
Serialize,
|
||||
Deserialize
|
||||
)]
|
||||
#[cfg_attr(feature = "tsify", derive(Tsify))]
|
||||
#[cfg_attr(feature = "tsify", tsify(into_wasm_abi, from_wasm_abi))]
|
||||
#[strum(use_phf)]
|
||||
#[repr(u8)]
|
||||
pub enum AirConditioningMode {
|
||||
@@ -65,6 +71,8 @@ impl TryFrom<f64> for AirConditioningMode {
|
||||
Serialize,
|
||||
Deserialize
|
||||
)]
|
||||
#[cfg_attr(feature = "tsify", derive(Tsify))]
|
||||
#[cfg_attr(feature = "tsify", tsify(into_wasm_abi, from_wasm_abi))]
|
||||
#[strum(use_phf)]
|
||||
#[repr(u8)]
|
||||
pub enum AirControlMode {
|
||||
@@ -115,6 +123,8 @@ impl TryFrom<f64> for AirControlMode {
|
||||
Serialize,
|
||||
Deserialize
|
||||
)]
|
||||
#[cfg_attr(feature = "tsify", derive(Tsify))]
|
||||
#[cfg_attr(feature = "tsify", tsify(into_wasm_abi, from_wasm_abi))]
|
||||
#[strum(use_phf)]
|
||||
#[repr(u8)]
|
||||
pub enum ColorType {
|
||||
@@ -189,6 +199,8 @@ impl TryFrom<f64> for ColorType {
|
||||
Serialize,
|
||||
Deserialize
|
||||
)]
|
||||
#[cfg_attr(feature = "tsify", derive(Tsify))]
|
||||
#[cfg_attr(feature = "tsify", tsify(into_wasm_abi, from_wasm_abi))]
|
||||
#[strum(use_phf)]
|
||||
#[repr(u8)]
|
||||
pub enum DaylightSensorMode {
|
||||
@@ -238,6 +250,8 @@ impl TryFrom<f64> for DaylightSensorMode {
|
||||
Serialize,
|
||||
Deserialize
|
||||
)]
|
||||
#[cfg_attr(feature = "tsify", derive(Tsify))]
|
||||
#[cfg_attr(feature = "tsify", tsify(into_wasm_abi, from_wasm_abi))]
|
||||
#[strum(use_phf)]
|
||||
#[repr(u8)]
|
||||
pub enum ElevatorMode {
|
||||
@@ -284,6 +298,8 @@ impl TryFrom<f64> for ElevatorMode {
|
||||
Serialize,
|
||||
Deserialize
|
||||
)]
|
||||
#[cfg_attr(feature = "tsify", derive(Tsify))]
|
||||
#[cfg_attr(feature = "tsify", tsify(into_wasm_abi, from_wasm_abi))]
|
||||
#[strum(use_phf)]
|
||||
#[repr(u8)]
|
||||
pub enum EntityState {
|
||||
@@ -333,6 +349,8 @@ impl TryFrom<f64> for EntityState {
|
||||
Serialize,
|
||||
Deserialize
|
||||
)]
|
||||
#[cfg_attr(feature = "tsify", derive(Tsify))]
|
||||
#[cfg_attr(feature = "tsify", tsify(into_wasm_abi, from_wasm_abi))]
|
||||
#[strum(use_phf)]
|
||||
#[repr(u32)]
|
||||
pub enum GasType {
|
||||
@@ -424,6 +442,8 @@ impl TryFrom<f64> for GasType {
|
||||
Serialize,
|
||||
Deserialize
|
||||
)]
|
||||
#[cfg_attr(feature = "tsify", derive(Tsify))]
|
||||
#[cfg_attr(feature = "tsify", tsify(into_wasm_abi, from_wasm_abi))]
|
||||
#[strum(use_phf)]
|
||||
#[repr(u8)]
|
||||
pub enum PowerMode {
|
||||
@@ -477,6 +497,8 @@ impl TryFrom<f64> for PowerMode {
|
||||
Serialize,
|
||||
Deserialize
|
||||
)]
|
||||
#[cfg_attr(feature = "tsify", derive(Tsify))]
|
||||
#[cfg_attr(feature = "tsify", tsify(into_wasm_abi, from_wasm_abi))]
|
||||
#[strum(use_phf)]
|
||||
#[repr(u8)]
|
||||
pub enum PrinterInstruction {
|
||||
@@ -548,6 +570,8 @@ impl TryFrom<f64> for PrinterInstruction {
|
||||
Serialize,
|
||||
Deserialize
|
||||
)]
|
||||
#[cfg_attr(feature = "tsify", derive(Tsify))]
|
||||
#[cfg_attr(feature = "tsify", tsify(into_wasm_abi, from_wasm_abi))]
|
||||
#[strum(use_phf)]
|
||||
#[repr(u8)]
|
||||
pub enum ReEntryProfile {
|
||||
@@ -602,6 +626,8 @@ impl TryFrom<f64> for ReEntryProfile {
|
||||
Serialize,
|
||||
Deserialize
|
||||
)]
|
||||
#[cfg_attr(feature = "tsify", derive(Tsify))]
|
||||
#[cfg_attr(feature = "tsify", tsify(into_wasm_abi, from_wasm_abi))]
|
||||
#[strum(use_phf)]
|
||||
#[repr(u8)]
|
||||
pub enum RobotMode {
|
||||
@@ -662,6 +688,8 @@ impl TryFrom<f64> for RobotMode {
|
||||
Serialize,
|
||||
Deserialize
|
||||
)]
|
||||
#[cfg_attr(feature = "tsify", derive(Tsify))]
|
||||
#[cfg_attr(feature = "tsify", tsify(into_wasm_abi, from_wasm_abi))]
|
||||
#[strum(use_phf)]
|
||||
#[repr(u8)]
|
||||
pub enum RocketMode {
|
||||
@@ -719,6 +747,8 @@ impl TryFrom<f64> for RocketMode {
|
||||
Serialize,
|
||||
Deserialize
|
||||
)]
|
||||
#[cfg_attr(feature = "tsify", derive(Tsify))]
|
||||
#[cfg_attr(feature = "tsify", tsify(into_wasm_abi, from_wasm_abi))]
|
||||
#[strum(use_phf)]
|
||||
#[repr(u8)]
|
||||
pub enum Class {
|
||||
@@ -878,6 +908,8 @@ impl TryFrom<f64> for Class {
|
||||
Serialize,
|
||||
Deserialize
|
||||
)]
|
||||
#[cfg_attr(feature = "tsify", derive(Tsify))]
|
||||
#[cfg_attr(feature = "tsify", tsify(into_wasm_abi, from_wasm_abi))]
|
||||
#[strum(use_phf)]
|
||||
#[repr(u8)]
|
||||
pub enum SorterInstruction {
|
||||
@@ -938,6 +970,8 @@ impl TryFrom<f64> for SorterInstruction {
|
||||
Serialize,
|
||||
Deserialize
|
||||
)]
|
||||
#[cfg_attr(feature = "tsify", derive(Tsify))]
|
||||
#[cfg_attr(feature = "tsify", tsify(into_wasm_abi, from_wasm_abi))]
|
||||
#[strum(use_phf)]
|
||||
#[repr(u8)]
|
||||
pub enum SortingClass {
|
||||
@@ -1010,6 +1044,8 @@ impl TryFrom<f64> for SortingClass {
|
||||
Serialize,
|
||||
Deserialize
|
||||
)]
|
||||
#[cfg_attr(feature = "tsify", derive(Tsify))]
|
||||
#[cfg_attr(feature = "tsify", tsify(into_wasm_abi, from_wasm_abi))]
|
||||
#[strum(use_phf)]
|
||||
#[repr(u8)]
|
||||
pub enum SoundAlert {
|
||||
@@ -1186,6 +1222,8 @@ impl TryFrom<f64> for SoundAlert {
|
||||
Serialize,
|
||||
Deserialize
|
||||
)]
|
||||
#[cfg_attr(feature = "tsify", derive(Tsify))]
|
||||
#[cfg_attr(feature = "tsify", tsify(into_wasm_abi, from_wasm_abi))]
|
||||
#[strum(use_phf)]
|
||||
#[repr(u8)]
|
||||
pub enum LogicTransmitterMode {
|
||||
@@ -1231,6 +1269,8 @@ impl TryFrom<f64> for LogicTransmitterMode {
|
||||
Serialize,
|
||||
Deserialize
|
||||
)]
|
||||
#[cfg_attr(feature = "tsify", derive(Tsify))]
|
||||
#[cfg_attr(feature = "tsify", tsify(into_wasm_abi, from_wasm_abi))]
|
||||
#[strum(use_phf)]
|
||||
#[repr(u8)]
|
||||
pub enum VentDirection {
|
||||
@@ -1274,6 +1314,8 @@ impl TryFrom<f64> for VentDirection {
|
||||
Serialize,
|
||||
Deserialize
|
||||
)]
|
||||
#[cfg_attr(feature = "tsify", derive(Tsify))]
|
||||
#[cfg_attr(feature = "tsify", tsify(into_wasm_abi, from_wasm_abi))]
|
||||
#[strum(use_phf)]
|
||||
#[repr(u8)]
|
||||
pub enum ConditionOperation {
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
use strum::{AsRefStr, Display, EnumIter, EnumProperty, EnumString, FromRepr};
|
||||
#[cfg(feature = "tsify")]
|
||||
use tsify::Tsify;
|
||||
#[cfg(feature = "tsify")]
|
||||
use wasm_bindgen::prelude::*;
|
||||
#[derive(
|
||||
Debug,
|
||||
Display,
|
||||
@@ -18,6 +22,8 @@ use strum::{AsRefStr, Display, EnumIter, EnumProperty, EnumString, FromRepr};
|
||||
Serialize,
|
||||
Deserialize
|
||||
)]
|
||||
#[cfg_attr(feature = "tsify", derive(Tsify))]
|
||||
#[cfg_attr(feature = "tsify", tsify(into_wasm_abi, from_wasm_abi))]
|
||||
#[strum(use_phf)]
|
||||
#[repr(i32)]
|
||||
pub enum StationpediaPrefab {
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
use strum::{AsRefStr, Display, EnumIter, EnumProperty, EnumString, FromRepr};
|
||||
#[cfg(feature = "tsify")]
|
||||
use tsify::Tsify;
|
||||
#[cfg(feature = "tsify")]
|
||||
use wasm_bindgen::prelude::*;
|
||||
#[derive(
|
||||
Debug,
|
||||
Display,
|
||||
@@ -18,6 +22,8 @@ use strum::{AsRefStr, Display, EnumIter, EnumProperty, EnumString, FromRepr};
|
||||
Serialize,
|
||||
Deserialize
|
||||
)]
|
||||
#[cfg_attr(feature = "tsify", derive(Tsify))]
|
||||
#[cfg_attr(feature = "tsify", tsify(into_wasm_abi, from_wasm_abi))]
|
||||
#[strum(use_phf)]
|
||||
#[repr(u8)]
|
||||
pub enum LogicBatchMethod {
|
||||
@@ -67,6 +73,8 @@ impl TryFrom<f64> for LogicBatchMethod {
|
||||
Serialize,
|
||||
Deserialize
|
||||
)]
|
||||
#[cfg_attr(feature = "tsify", derive(Tsify))]
|
||||
#[cfg_attr(feature = "tsify", tsify(into_wasm_abi, from_wasm_abi))]
|
||||
#[strum(use_phf)]
|
||||
#[repr(u8)]
|
||||
pub enum LogicReagentMode {
|
||||
@@ -117,6 +125,8 @@ impl TryFrom<f64> for LogicReagentMode {
|
||||
Serialize,
|
||||
Deserialize
|
||||
)]
|
||||
#[cfg_attr(feature = "tsify", derive(Tsify))]
|
||||
#[cfg_attr(feature = "tsify", tsify(into_wasm_abi, from_wasm_abi))]
|
||||
#[strum(use_phf)]
|
||||
#[repr(u8)]
|
||||
pub enum LogicSlotType {
|
||||
@@ -310,6 +320,8 @@ impl TryFrom<f64> for LogicSlotType {
|
||||
Serialize,
|
||||
Deserialize
|
||||
)]
|
||||
#[cfg_attr(feature = "tsify", derive(Tsify))]
|
||||
#[cfg_attr(feature = "tsify", tsify(into_wasm_abi, from_wasm_abi))]
|
||||
#[strum(use_phf)]
|
||||
#[repr(u16)]
|
||||
pub enum LogicType {
|
||||
|
||||
@@ -3,12 +3,18 @@ use std::collections::BTreeMap;
|
||||
pub mod templates;
|
||||
pub mod enums {
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
|
||||
#[cfg(feature = "tsify")]
|
||||
use tsify::Tsify;
|
||||
#[cfg(feature = "tsify")]
|
||||
use wasm_bindgen::prelude::*;
|
||||
|
||||
use std::fmt::Display;
|
||||
use strum::{AsRefStr, EnumIter, EnumString, FromRepr};
|
||||
|
||||
pub mod basic;
|
||||
pub mod script;
|
||||
pub mod prefabs;
|
||||
pub mod script;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct ParseError {
|
||||
@@ -26,6 +32,8 @@ pub mod enums {
|
||||
#[derive(
|
||||
Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize, EnumString,
|
||||
)]
|
||||
#[cfg_attr(feature = "tsify", derive(Tsify))]
|
||||
#[cfg_attr(feature = "tsify", tsify(into_wasm_abi, from_wasm_abi))]
|
||||
pub enum MemoryAccess {
|
||||
Read,
|
||||
Write,
|
||||
@@ -49,6 +57,8 @@ pub mod enums {
|
||||
FromRepr,
|
||||
EnumString,
|
||||
)]
|
||||
#[cfg_attr(feature = "tsify", derive(Tsify))]
|
||||
#[cfg_attr(feature = "tsify", tsify(into_wasm_abi, from_wasm_abi))]
|
||||
pub enum ConnectionType {
|
||||
Pipe,
|
||||
Power,
|
||||
@@ -81,6 +91,8 @@ pub mod enums {
|
||||
FromRepr,
|
||||
EnumString,
|
||||
)]
|
||||
#[cfg_attr(feature = "tsify", derive(Tsify))]
|
||||
#[cfg_attr(feature = "tsify", tsify(into_wasm_abi, from_wasm_abi))]
|
||||
pub enum ConnectionRole {
|
||||
Input,
|
||||
Input2,
|
||||
@@ -92,7 +104,6 @@ pub mod enums {
|
||||
None,
|
||||
}
|
||||
|
||||
|
||||
#[derive(
|
||||
Debug,
|
||||
Default,
|
||||
@@ -110,6 +121,8 @@ pub mod enums {
|
||||
FromRepr,
|
||||
EnumString,
|
||||
)]
|
||||
#[cfg_attr(feature = "tsify", derive(Tsify))]
|
||||
#[cfg_attr(feature = "tsify", tsify(into_wasm_abi, from_wasm_abi))]
|
||||
#[repr(u32)]
|
||||
pub enum MachineTier {
|
||||
#[default]
|
||||
@@ -120,6 +133,33 @@ pub mod enums {
|
||||
#[serde(other)]
|
||||
Max,
|
||||
}
|
||||
|
||||
#[derive(
|
||||
Default,
|
||||
Debug,
|
||||
Clone,
|
||||
Copy,
|
||||
PartialEq,
|
||||
Eq,
|
||||
PartialOrd,
|
||||
Ord,
|
||||
Hash,
|
||||
EnumString,
|
||||
AsRefStr,
|
||||
EnumIter,
|
||||
FromRepr,
|
||||
Serialize,
|
||||
Deserialize,
|
||||
)]
|
||||
#[cfg_attr(feature = "tsify", derive(Tsify))]
|
||||
#[cfg_attr(feature = "tsify", tsify(into_wasm_abi, from_wasm_abi))]
|
||||
pub enum Species {
|
||||
None,
|
||||
#[default]
|
||||
Human,
|
||||
Zrilian,
|
||||
Robot,
|
||||
}
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
|
||||
@@ -3,11 +3,17 @@ use std::collections::BTreeMap;
|
||||
use crate::enums::{
|
||||
basic::{Class as SlotClass, GasType, SortingClass},
|
||||
script::{LogicSlotType, LogicType},
|
||||
ConnectionRole, ConnectionType, MachineTier, MemoryAccess,
|
||||
ConnectionRole, ConnectionType, MachineTier, MemoryAccess, Species,
|
||||
};
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
#[cfg(feature = "tsify")]
|
||||
use tsify::Tsify;
|
||||
#[cfg(feature = "tsify")]
|
||||
use wasm_bindgen::prelude::*;
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, PartialOrd, Serialize, Deserialize)]
|
||||
#[cfg_attr(feature = "tsify", derive(Tsify))]
|
||||
#[cfg_attr(feature = "tsify", tsify(into_wasm_abi, from_wasm_abi))]
|
||||
#[serde(untagged)]
|
||||
pub enum ObjectTemplate {
|
||||
Structure(StructureTemplate),
|
||||
@@ -27,6 +33,7 @@ pub enum ObjectTemplate {
|
||||
ItemSuit(ItemSuitTemplate),
|
||||
ItemSuitLogic(ItemSuitLogicTemplate),
|
||||
ItemSuitCircuitHolder(ItemSuitCircuitHolderTemplate),
|
||||
Human(HumanTemplate),
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
@@ -53,6 +60,7 @@ impl ObjectTemplate {
|
||||
ItemSuit(i) => &i.prefab,
|
||||
ItemSuitLogic(i) => &i.prefab,
|
||||
ItemSuitCircuitHolder(i) => &i.prefab,
|
||||
Human(h) => &h.prefab,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -158,20 +166,42 @@ impl From<StructureCircuitHolderTemplate> for ObjectTemplate {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<HumanTemplate> for ObjectTemplate {
|
||||
fn from(value: HumanTemplate) -> Self {
|
||||
Self::Human(value)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, PartialOrd, Serialize, Deserialize)]
|
||||
#[cfg_attr(feature = "tsify", derive(Tsify))]
|
||||
#[cfg_attr(feature = "tsify", tsify(into_wasm_abi, from_wasm_abi))]
|
||||
pub struct HumanTemplate {
|
||||
pub prefab: PrefabInfo,
|
||||
pub species: Species,
|
||||
pub slots: Vec<SlotInfo>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, PartialOrd, Eq, Ord, Hash, Serialize, Deserialize)]
|
||||
#[cfg_attr(feature = "tsify", derive(Tsify))]
|
||||
#[cfg_attr(feature = "tsify", tsify(into_wasm_abi, from_wasm_abi))]
|
||||
pub struct PrefabInfo {
|
||||
pub prefab_name: String,
|
||||
pub prefab_hash: i32,
|
||||
pub desc: String,
|
||||
pub name: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, PartialOrd, Serialize, Deserialize)]
|
||||
#[cfg_attr(feature = "tsify", derive(Tsify))]
|
||||
#[cfg_attr(feature = "tsify", tsify(into_wasm_abi, from_wasm_abi))]
|
||||
pub struct SlotInfo {
|
||||
pub name: String,
|
||||
pub typ: SlotClass,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, PartialOrd, Serialize, Deserialize)]
|
||||
#[cfg_attr(feature = "tsify", derive(Tsify))]
|
||||
#[cfg_attr(feature = "tsify", tsify(into_wasm_abi, from_wasm_abi))]
|
||||
pub struct LogicInfo {
|
||||
pub logic_slot_types: BTreeMap<u32, BTreeMap<LogicSlotType, MemoryAccess>>,
|
||||
pub logic_types: BTreeMap<LogicType, MemoryAccess>,
|
||||
@@ -182,6 +212,8 @@ pub struct LogicInfo {
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, PartialOrd, Serialize, Deserialize)]
|
||||
#[cfg_attr(feature = "tsify", derive(Tsify))]
|
||||
#[cfg_attr(feature = "tsify", tsify(into_wasm_abi, from_wasm_abi))]
|
||||
pub struct ItemInfo {
|
||||
pub consumable: bool,
|
||||
pub filter_type: Option<GasType>,
|
||||
@@ -193,6 +225,8 @@ pub struct ItemInfo {
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, PartialOrd, Eq, Ord, Hash, Serialize, Deserialize)]
|
||||
#[cfg_attr(feature = "tsify", derive(Tsify))]
|
||||
#[cfg_attr(feature = "tsify", tsify(into_wasm_abi, from_wasm_abi))]
|
||||
pub struct ConnectionInfo {
|
||||
pub typ: ConnectionType,
|
||||
pub role: ConnectionRole,
|
||||
@@ -200,6 +234,8 @@ pub struct ConnectionInfo {
|
||||
|
||||
#[allow(clippy::struct_excessive_bools)]
|
||||
#[derive(Clone, Debug, PartialEq, PartialOrd, Serialize, Deserialize)]
|
||||
#[cfg_attr(feature = "tsify", derive(Tsify))]
|
||||
#[cfg_attr(feature = "tsify", tsify(into_wasm_abi, from_wasm_abi))]
|
||||
pub struct DeviceInfo {
|
||||
pub connection_list: Vec<ConnectionInfo>,
|
||||
pub device_pins_length: Option<u32>,
|
||||
@@ -214,12 +250,16 @@ pub struct DeviceInfo {
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, PartialOrd, Serialize, Deserialize)]
|
||||
#[cfg_attr(feature = "tsify", derive(Tsify))]
|
||||
#[cfg_attr(feature = "tsify", tsify(into_wasm_abi, from_wasm_abi))]
|
||||
pub struct ConsumerInfo {
|
||||
pub consumed_resouces: Vec<String>,
|
||||
pub processed_reagents: Vec<i32>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, PartialOrd, Serialize, Deserialize)]
|
||||
#[cfg_attr(feature = "tsify", derive(Tsify))]
|
||||
#[cfg_attr(feature = "tsify", tsify(into_wasm_abi, from_wasm_abi))]
|
||||
pub struct RecipeRange {
|
||||
pub start: f64,
|
||||
pub stop: f64,
|
||||
@@ -227,6 +267,8 @@ pub struct RecipeRange {
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, PartialOrd, Serialize, Deserialize)]
|
||||
#[cfg_attr(feature = "tsify", derive(Tsify))]
|
||||
#[cfg_attr(feature = "tsify", tsify(into_wasm_abi, from_wasm_abi))]
|
||||
pub struct RecipeGasMix {
|
||||
pub rule: i64,
|
||||
pub is_any: bool,
|
||||
@@ -235,6 +277,8 @@ pub struct RecipeGasMix {
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, PartialOrd, Serialize, Deserialize)]
|
||||
#[cfg_attr(feature = "tsify", derive(Tsify))]
|
||||
#[cfg_attr(feature = "tsify", tsify(into_wasm_abi, from_wasm_abi))]
|
||||
pub struct Recipe {
|
||||
pub tier: MachineTier,
|
||||
pub time: f64,
|
||||
@@ -243,21 +287,27 @@ pub struct Recipe {
|
||||
pub pressure: RecipeRange,
|
||||
pub required_mix: RecipeGasMix,
|
||||
pub count_types: i64,
|
||||
pub reagents: BTreeMap<String, f64>
|
||||
pub reagents: BTreeMap<String, f64>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, PartialOrd, Serialize, Deserialize)]
|
||||
#[cfg_attr(feature = "tsify", derive(Tsify))]
|
||||
#[cfg_attr(feature = "tsify", tsify(into_wasm_abi, from_wasm_abi))]
|
||||
pub struct FabricatorInfo {
|
||||
pub tier: MachineTier,
|
||||
pub recipes: BTreeMap<String, Recipe>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, PartialOrd, Eq, Ord, Hash, Serialize, Deserialize)]
|
||||
#[cfg_attr(feature = "tsify", derive(Tsify))]
|
||||
#[cfg_attr(feature = "tsify", tsify(into_wasm_abi, from_wasm_abi))]
|
||||
pub struct StructureInfo {
|
||||
pub small_grid: bool,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, PartialOrd, Eq, Ord, Hash, Serialize, Deserialize)]
|
||||
#[cfg_attr(feature = "tsify", derive(Tsify))]
|
||||
#[cfg_attr(feature = "tsify", tsify(into_wasm_abi, from_wasm_abi))]
|
||||
pub struct Instruction {
|
||||
pub description: String,
|
||||
pub typ: String,
|
||||
@@ -265,6 +315,8 @@ pub struct Instruction {
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, PartialOrd, Serialize, Deserialize)]
|
||||
#[cfg_attr(feature = "tsify", derive(Tsify))]
|
||||
#[cfg_attr(feature = "tsify", tsify(into_wasm_abi, from_wasm_abi))]
|
||||
pub struct MemoryInfo {
|
||||
pub instructions: Option<BTreeMap<String, Instruction>>,
|
||||
pub memory_access: MemoryAccess,
|
||||
@@ -272,23 +324,31 @@ pub struct MemoryInfo {
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, PartialOrd, Serialize, Deserialize)]
|
||||
#[cfg_attr(feature = "tsify", derive(Tsify))]
|
||||
#[cfg_attr(feature = "tsify", tsify(into_wasm_abi, from_wasm_abi))]
|
||||
pub struct ThermalInfo {
|
||||
pub convection_factor: f32,
|
||||
pub radiation_factor: f32,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, PartialOrd, Serialize, Deserialize)]
|
||||
#[cfg_attr(feature = "tsify", derive(Tsify))]
|
||||
#[cfg_attr(feature = "tsify", tsify(into_wasm_abi, from_wasm_abi))]
|
||||
pub struct InternalAtmoInfo {
|
||||
pub volume: f32,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, PartialOrd, Serialize, Deserialize)]
|
||||
#[cfg_attr(feature = "tsify", derive(Tsify))]
|
||||
#[cfg_attr(feature = "tsify", tsify(into_wasm_abi, from_wasm_abi))]
|
||||
pub struct SuitInfo {
|
||||
pub hygine_reduction_multiplier: f32,
|
||||
pub waste_max_pressure: f32,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, PartialOrd, Serialize, Deserialize)]
|
||||
#[cfg_attr(feature = "tsify", derive(Tsify))]
|
||||
#[cfg_attr(feature = "tsify", tsify(into_wasm_abi, from_wasm_abi))]
|
||||
pub struct StructureTemplate {
|
||||
pub prefab: PrefabInfo,
|
||||
pub structure: StructureInfo,
|
||||
@@ -297,6 +357,8 @@ pub struct StructureTemplate {
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, PartialOrd, Serialize, Deserialize)]
|
||||
#[cfg_attr(feature = "tsify", derive(Tsify))]
|
||||
#[cfg_attr(feature = "tsify", tsify(into_wasm_abi, from_wasm_abi))]
|
||||
pub struct StructureSlotsTemplate {
|
||||
pub prefab: PrefabInfo,
|
||||
pub structure: StructureInfo,
|
||||
@@ -306,6 +368,8 @@ pub struct StructureSlotsTemplate {
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, PartialOrd, Serialize, Deserialize)]
|
||||
#[cfg_attr(feature = "tsify", derive(Tsify))]
|
||||
#[cfg_attr(feature = "tsify", tsify(into_wasm_abi, from_wasm_abi))]
|
||||
pub struct StructureLogicTemplate {
|
||||
pub prefab: PrefabInfo,
|
||||
pub structure: StructureInfo,
|
||||
@@ -316,6 +380,8 @@ pub struct StructureLogicTemplate {
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, PartialOrd, Serialize, Deserialize)]
|
||||
#[cfg_attr(feature = "tsify", derive(Tsify))]
|
||||
#[cfg_attr(feature = "tsify", tsify(into_wasm_abi, from_wasm_abi))]
|
||||
pub struct StructureLogicDeviceTemplate {
|
||||
pub prefab: PrefabInfo,
|
||||
pub structure: StructureInfo,
|
||||
@@ -327,6 +393,8 @@ pub struct StructureLogicDeviceTemplate {
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, PartialOrd, Serialize, Deserialize)]
|
||||
#[cfg_attr(feature = "tsify", derive(Tsify))]
|
||||
#[cfg_attr(feature = "tsify", tsify(into_wasm_abi, from_wasm_abi))]
|
||||
pub struct StructureLogicDeviceConsumerTemplate {
|
||||
pub prefab: PrefabInfo,
|
||||
pub structure: StructureInfo,
|
||||
@@ -340,6 +408,8 @@ pub struct StructureLogicDeviceConsumerTemplate {
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, PartialOrd, Serialize, Deserialize)]
|
||||
#[cfg_attr(feature = "tsify", derive(Tsify))]
|
||||
#[cfg_attr(feature = "tsify", tsify(into_wasm_abi, from_wasm_abi))]
|
||||
pub struct StructureLogicDeviceMemoryTemplate {
|
||||
pub prefab: PrefabInfo,
|
||||
pub structure: StructureInfo,
|
||||
@@ -352,6 +422,8 @@ pub struct StructureLogicDeviceMemoryTemplate {
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, PartialOrd, Serialize, Deserialize)]
|
||||
#[cfg_attr(feature = "tsify", derive(Tsify))]
|
||||
#[cfg_attr(feature = "tsify", tsify(into_wasm_abi, from_wasm_abi))]
|
||||
pub struct StructureCircuitHolderTemplate {
|
||||
pub prefab: PrefabInfo,
|
||||
pub structure: StructureInfo,
|
||||
@@ -363,6 +435,8 @@ pub struct StructureCircuitHolderTemplate {
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, PartialOrd, Serialize, Deserialize)]
|
||||
#[cfg_attr(feature = "tsify", derive(Tsify))]
|
||||
#[cfg_attr(feature = "tsify", tsify(into_wasm_abi, from_wasm_abi))]
|
||||
pub struct StructureLogicDeviceConsumerMemoryTemplate {
|
||||
pub prefab: PrefabInfo,
|
||||
pub structure: StructureInfo,
|
||||
@@ -377,6 +451,8 @@ pub struct StructureLogicDeviceConsumerMemoryTemplate {
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, PartialOrd, Serialize, Deserialize)]
|
||||
#[cfg_attr(feature = "tsify", derive(Tsify))]
|
||||
#[cfg_attr(feature = "tsify", tsify(into_wasm_abi, from_wasm_abi))]
|
||||
pub struct ItemTemplate {
|
||||
pub prefab: PrefabInfo,
|
||||
pub item: ItemInfo,
|
||||
@@ -385,6 +461,8 @@ pub struct ItemTemplate {
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, PartialOrd, Serialize, Deserialize)]
|
||||
#[cfg_attr(feature = "tsify", derive(Tsify))]
|
||||
#[cfg_attr(feature = "tsify", tsify(into_wasm_abi, from_wasm_abi))]
|
||||
pub struct ItemSlotsTemplate {
|
||||
pub prefab: PrefabInfo,
|
||||
pub item: ItemInfo,
|
||||
@@ -394,6 +472,8 @@ pub struct ItemSlotsTemplate {
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, PartialOrd, Serialize, Deserialize)]
|
||||
#[cfg_attr(feature = "tsify", derive(Tsify))]
|
||||
#[cfg_attr(feature = "tsify", tsify(into_wasm_abi, from_wasm_abi))]
|
||||
pub struct ItemConsumerTemplate {
|
||||
pub prefab: PrefabInfo,
|
||||
pub item: ItemInfo,
|
||||
@@ -404,6 +484,8 @@ pub struct ItemConsumerTemplate {
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, PartialOrd, Serialize, Deserialize)]
|
||||
#[cfg_attr(feature = "tsify", derive(Tsify))]
|
||||
#[cfg_attr(feature = "tsify", tsify(into_wasm_abi, from_wasm_abi))]
|
||||
pub struct ItemLogicTemplate {
|
||||
pub prefab: PrefabInfo,
|
||||
pub item: ItemInfo,
|
||||
@@ -414,6 +496,8 @@ pub struct ItemLogicTemplate {
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, PartialOrd, Serialize, Deserialize)]
|
||||
#[cfg_attr(feature = "tsify", derive(Tsify))]
|
||||
#[cfg_attr(feature = "tsify", tsify(into_wasm_abi, from_wasm_abi))]
|
||||
pub struct ItemLogicMemoryTemplate {
|
||||
pub prefab: PrefabInfo,
|
||||
pub item: ItemInfo,
|
||||
@@ -425,6 +509,8 @@ pub struct ItemLogicMemoryTemplate {
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, PartialOrd, Serialize, Deserialize)]
|
||||
#[cfg_attr(feature = "tsify", derive(Tsify))]
|
||||
#[cfg_attr(feature = "tsify", tsify(into_wasm_abi, from_wasm_abi))]
|
||||
pub struct ItemCircuitHolderTemplate {
|
||||
pub prefab: PrefabInfo,
|
||||
pub item: ItemInfo,
|
||||
@@ -435,6 +521,8 @@ pub struct ItemCircuitHolderTemplate {
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, PartialOrd, Serialize, Deserialize)]
|
||||
#[cfg_attr(feature = "tsify", derive(Tsify))]
|
||||
#[cfg_attr(feature = "tsify", tsify(into_wasm_abi, from_wasm_abi))]
|
||||
pub struct ItemSuitTemplate {
|
||||
pub prefab: PrefabInfo,
|
||||
pub item: ItemInfo,
|
||||
@@ -445,6 +533,8 @@ pub struct ItemSuitTemplate {
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, PartialOrd, Serialize, Deserialize)]
|
||||
#[cfg_attr(feature = "tsify", derive(Tsify))]
|
||||
#[cfg_attr(feature = "tsify", tsify(into_wasm_abi, from_wasm_abi))]
|
||||
pub struct ItemSuitLogicTemplate {
|
||||
pub prefab: PrefabInfo,
|
||||
pub item: ItemInfo,
|
||||
@@ -456,6 +546,8 @@ pub struct ItemSuitLogicTemplate {
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, PartialOrd, Serialize, Deserialize)]
|
||||
#[cfg_attr(feature = "tsify", derive(Tsify))]
|
||||
#[cfg_attr(feature = "tsify", tsify(into_wasm_abi, from_wasm_abi))]
|
||||
pub struct ItemSuitCircuitHolderTemplate {
|
||||
pub prefab: PrefabInfo,
|
||||
pub item: ItemInfo,
|
||||
|
||||
Reference in New Issue
Block a user