Skip to content

auto_sub_states to match with auto_states #54

@jwright159

Description

@jwright159

Just as

#[derive(States, Debug, Default, Copy, Clone, PartialEq, Eq, Hash, Reflect)]
#[auto_init_state(plugin = MyPlugin)]
#[auto_register_state_type(plugin = MyPlugin)]
enum FooState {
    #[default]
    Start,
    End,
}

can be replaced with

#[auto_states(plugin = MyPlugin, derive, reflect, register, init)]
enum FooState {
    #[default]
    Start,
    End,
}

then

#[derive(SubStates, Debug, Default, Copy, Clone, PartialEq, Eq, Hash, Reflect)]
#[source(AppState = AppState::InGame)]
#[auto_init_sub_state(plugin = MyPlugin)]
#[auto_register_state_type(plugin = MyPlugin)]
enum GamePhase {
    #[default]
    Setup,
    Battle,
    Conclusion
}

should be able to be replaced with

#[auto_sub_states(plugin = MyPlugin, derive, reflect, register, init)]
#[source(AppState = AppState::InGame)]
enum GamePhase {
    #[default]
    Setup,
    Battle,
    Conclusion
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions