wow_cdbc/
types.rs

1//! Common types used throughout the library
2
3/// Represents a key in a DBC file
4pub type Key = u32;
5
6/// Represents a string reference in a DBC file
7#[derive(Debug, Clone, Copy, PartialEq, Eq)]
8pub struct StringRef(pub u32);
9
10impl StringRef {
11    /// Create a new string reference from an offset
12    pub fn new(offset: u32) -> Self {
13        Self(offset)
14    }
15
16    /// Get the offset of the string reference
17    pub fn offset(&self) -> u32 {
18        self.0
19    }
20}