Skip to content

Commit 518267d

Browse files
committed
N46: seldom_state style fixes
1 parent 832da03 commit 518267d

File tree

1 file changed

+9
-21
lines changed

1 file changed

+9
-21
lines changed

content/news/046/index.md

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -85,35 +85,23 @@ for player controllers, animations, simple AI, etc.
8585
This month, [seldom_state] 0.6 was released:
8686

8787
- Triggers don't need to be registered!
88-
- `StateMachine::new(MachineState)` has been replaced with
89-
`StateMachine::default()`, and you must insert the initial state manually
90-
- `MachineState` requires `Component` now instead of `Bundle`
9188
- `MachineState` and `Trigger` no longer require `Reflect`
92-
- `StateMachine`'s
93-
`trans_builder(Trigger, Fn(&Trigger::Ok) -> Option<MyNextState>)` is now
94-
`trans_builder(Trigger, Fn(&MyCurrentState, Trigger::Ok) -> Option<MyNextState>)`,
95-
so you can take information from the current state when building the next!
96-
- `StateMachine` no longer tracks the current state, so you may add and remove
97-
state components manually, as long as it's still in one state. Manual state
98-
changes won't trigger `on_enter` etc events. States that aren't used in any
99-
transitions can be registered manually with `StateMachine::with_state`, else it
100-
will think it isn't in a state and panic.
101-
- Replaced `StateMachine`'s `insert_on_enter(Bundle)` and `remove_on_exit()`
102-
with the more versatile `on_enter(Fn(&mut EntityCommands))`,
103-
`on_exit(Fn(&mut EntityCommands))`, `command_on_enter(Command)`, and
104-
`command_on_exit(Command)`
105-
- `Trigger`s may be combined with combinators `not`, `and`, and `or`
89+
- `StateMachine`'s `trans_builder` accepts the current state in the closure, so
90+
you have dataflow between states!
91+
- You may add and remove state components manually
92+
- More versatile `on_enter` and `on_exit` events
93+
- `Trigger` combinators `not`, `and`, and `or`
10694
- Transitions have priority in the order they are added
107-
- `Trigger::trigger` accepts `ReadOnlySystemParam` instead of `&SystemParam`, so
108-
you can use `EventReader`, `Local`, etc in your triggers!
95+
- You can use `EventReader`, `Local`, etc in your triggers!
10996
- Added an `EventTrigger<E>` that triggers on an event
110-
- `StateMachine::set_trans_logging` sets whether to log state transitions for
111-
debugging.
97+
- `StateMachine`'s `set_trans_logging` sets whether to log state transitions
98+
- [And more][changelog]!
11299

113100
Thanks to [Sera] for coauthoring this update!
114101

115102
[seldom_state]: https://github.com/Seldom-SE/seldom_state
116103
[Sera]: https://github.com/deifactor
104+
[changelog]: https://github.com/Seldom-SE/seldom_state/blob/main/CHANGELOG.md#06-2023-05-07
117105

118106
## Popular Workgroup Issues in Github
119107

0 commit comments

Comments
 (0)