summaryrefslogtreecommitdiff
path: root/src/to_clt/env.rs
blob: f242298e5ac73956da9e5986ef7e8b2b85730c8e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
use super::*;

#[mt_derive(to = "clt")]
pub struct ObjAdd; // TODO

#[mt_derive(to = "clt")]
pub struct ObjMsg; // TODO

#[mt_derive(to = "clt", repr = "u8", enumset)]
pub enum MapBlockFlag {
    IsUnderground = 0,
    DayNightDiff,
    LightExpired,
    NotGenerated,
}

pub const ALWAYS_LIT_FROM: u16 = 0xf000;

#[mt_derive(to = "clt")]
pub struct MapBlock {
    pub flags: EnumSet<MapBlockFlag>,
    pub lit_from: u16,

    #[mt(const8 = 2)]
    #[serde(skip)]
    pub param0_size: (),

    #[mt(const8 = 2)]
    #[serde(skip)]
    pub param12_size: (),

    #[serde(with = "serde_arrays")]
    pub param_0: [u16; 4096],
    #[serde(with = "serde_arrays")]
    pub param_1: [u8; 4096],
    #[serde(with = "serde_arrays")]
    pub param_2: [u8; 4096],

    pub node_metas: HashMap<u16, NodeMeta>,

    #[mt(const8 = 2)]
    #[serde(skip)]
    pub version: (),
}