Skip to main content

warcraft3_stats_observer/
shop_good.rs

1use crate::string_utils::PaddedString;
2
3const MAX_NAME_LENGTH: usize = 100;
4
5/// State for a single item offered for sale at a shop.
6#[repr(C, packed)]
7pub struct ShopGoodInfo {
8    /// Game-internal item ID.
9    pub id: u32,
10    /// Display name.
11    pub name: PaddedString<MAX_NAME_LENGTH>,
12    /// Amount of item in stock.
13    pub stock: u32,
14    /// Maximum units that can be stocked.
15    pub max_stock: u32,
16    /// Restock cooldown, in seconds.
17    pub cooldown: f32,
18    /// Time remaining before the next restock, in seconds.
19    pub cooldown_remaining: f32,
20}
21
22// Number generated from SIZE fields of https://github.com/TinkerWorX/Blizzard.Net.Warcraft3
23// noinspection RsAssertEqual
24const _: () = assert!(size_of::<ShopGoodInfo>() == 120);