use core::ffi::c_void;
use crate::abi::{Header, Status, Str};
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub struct ResourceKey {
pub guid: [u8; 16],
pub type_hash: u32,
pub part: u32,
}
pub type ResourcePatchFn = unsafe extern "system" fn(
base: *const u8,
base_len: usize,
user: *mut c_void,
out: *mut *const u8,
out_len: *mut usize,
) -> Status;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub struct RecipeRuleKind(pub u32);
impl RecipeRuleKind {
pub const RECIPE: Self = Self(0);
pub const OUTPUT: Self = Self(1);
pub const WORKSHOP: Self = Self(2);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub struct RecipeKind(pub u32);
impl RecipeKind {
pub const OTHER: Self = Self(0);
pub const BUILDING_BLOCK: Self = Self(1);
pub const ROOF: Self = Self(2);
pub const OVERGROWTH: Self = Self(3);
pub const TERRAIN: Self = Self(4);
pub const DECORATIVE: Self = Self(5);
pub const COMFORT_FURNITURE: Self = Self(6);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, bytemuck::Zeroable)]
pub struct DataField(pub u32);
impl DataField {
pub const MAX_STACK: Self = Self(1);
pub const RECIPE_OUTPUT: Self = Self(2);
pub const RECIPE_COST: Self = Self(3);
pub const RECIPE_INGREDIENT: Self = Self(4);
pub const RECIPE_TIME: Self = Self(5);
pub const CONTAINER_SLOTS: Self = Self(6);
pub const DAMAGE_MOD: Self = Self(7);
pub const SPEED_MOD: Self = Self(8);
pub const ARMOR: Self = Self(9);
pub const BURN_TIME: Self = Self(10);
pub const ENERGY_OUTPUT: Self = Self(11);
pub const COMFORT_AMOUNT: Self = Self(12);
pub const LOOT_STACK_SIZE: Self = Self(13);
pub const LOOT_COUNT: Self = Self(14);
pub const LOOT_SPAWN_PROBABILITY: Self = Self(15);
pub const LOOT_WEIGHT: Self = Self(16);
pub const RECIPE_STATION: Self = Self(17);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, bytemuck::Zeroable)]
pub struct ChangeOp(pub u32);
impl ChangeOp {
pub const SET: Self = Self(0);
pub const TIMES: Self = Self(1);
pub const RESET: Self = Self(2);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, bytemuck::Zeroable)]
pub struct ChangeId(pub u32);
#[repr(C)]
#[derive(Clone, Copy, Debug, bytemuck::Zeroable)]
pub struct DataChange {
pub header: Header,
pub entry: [u8; 16],
pub field: DataField,
pub op: ChangeOp,
pub value: f64,
pub source: Str,
pub item: [u8; 16],
pub select: DataSelect,
pub categories: u32,
}
impl_headed!(DataChange);
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, bytemuck::Zeroable)]
pub struct DataSelect(pub u32);
impl DataSelect {
pub const ENTRY: Self = Self(0);
pub const CATEGORY: Self = Self(1);
pub const STACKABLE: Self = Self(2);
pub const CONTAINERS: Self = Self(3);
pub const RECIPE_KIND: Self = Self(4);
pub const WORKSHOP: Self = Self(5);
pub const BACKPACKS: Self = Self(6);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub struct EntityDataFlags(pub u32);
impl EntityDataFlags {
pub const NONE: Self = Self(0);
pub const SENT: Self = Self(1);
}