warcraft3-stats-observer 0.1.1

Rust bindings for the Warcraft 3 Stats Observer API memory map
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use crate::string_utils::PaddedString;

const MAX_NAME_LENGTH: usize = 100;
const MAX_BUTTON_ART_LENGTH: usize = 100;

#[repr(C, packed)]
pub struct ItemInfo {
    id: u32,
    name: PaddedString<MAX_NAME_LENGTH>,
    slot: u32,
    charges: u32,
    button_art: PaddedString<MAX_BUTTON_ART_LENGTH>,
}
// Number generated from SIZE fields of https://github.com/TinkerWorX/Blizzard.Net.Warcraft3
// noinspection RsAssertEqual
const _: () = assert!(size_of::<ItemInfo>() == 212);