wolfrpg_map_parser/command/set_variable_plus_command/
character_field.rs

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
45
46
47
48
49
50
51
#[cfg(feature = "serde")]
use serde::Serialize;

#[cfg_attr(feature = "serde", derive(Serialize))]
pub enum CharacterField {
    StandardX               = 0x00000000,
    StandardY               = 0x00000001,
    PreciseX                = 0x00000002,
    PreciseY                = 0x00000003,
    HeightOffGround         = 0x00000004,
    Direction               = 0x00000005,
    ScreenX                 = 0x00000006,
    ScreenY                 = 0x00000007,
    ShadowGraphicNumber     = 0x00000008,
    CurrentTileTag          = 0x00000009,
    EventId                 = 0x0000000a,
    OnScreen                = 0x0000000b,
    ActivePage              = 0x0000000c,
    RunCondition            = 0x0000000d,
    RangeExtendX            = 0x0000000e,
    RangeExtendY            = 0x0000000f,
    AnimationPattern        = 0x00000010,
    Moving                  = 0x00000011,
    Unknown
}

impl CharacterField {
    pub const fn new(field: u32) -> Self {
        match field {
            0x00000000 => CharacterField::StandardX,
            0x00000001 => CharacterField::StandardY,
            0x00000002 => CharacterField::PreciseX,
            0x00000003 => CharacterField::PreciseY,
            0x00000004 => CharacterField::HeightOffGround,
            0x00000005 => CharacterField::Direction,
            0x00000006 => CharacterField::ScreenX,
            0x00000007 => CharacterField::ScreenY,
            0x00000008 => CharacterField::ShadowGraphicNumber,
            0x00000009 => CharacterField::CurrentTileTag,
            0x0000000a => CharacterField::EventId,
            0x0000000b => CharacterField::OnScreen,
            0x0000000c => CharacterField::ActivePage,
            0x0000000d => CharacterField::RunCondition,
            0x0000000e => CharacterField::RangeExtendX,
            0x0000000f => CharacterField::RangeExtendY,
            0x00000010 => CharacterField::AnimationPattern,
            0x00000011 => CharacterField::Moving,
            _ => CharacterField::Unknown
        }
    }
}