Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Seldom-SE/seldom_state
/ functions
Functions
94 in github.com/Seldom-SE/seldom_state
⨍
Functions
94
◇
Types & classes
57
↓ 19 callers
Method
into_trigger
(self)
src/trigger.rs:200
↓ 8 callers
Method
into_result
(self)
src/trigger.rs:78
↓ 6 callers
Method
push
(&mut self, res: Result<T, E>)
src/lib.rs:79
↓ 5 callers
Function
axis_pair
Trigger that transitions if the given [`Actionlike`]'s [`DualAxisData`] is within the given bounds. If no minimum length is necessary, use `0.`. To e
src/trigger/input.rs:104
↓ 5 callers
Function
clamped_axis_pair
[`axis_pair`] with axes clamped to [-1, 1]
src/trigger/input.rs:185
↓ 5 callers
Method
run
Runs all transitions until one is actually taken. If one is taken, logs the transition and runs `on_enter/on_exit` triggers. TODO Defer the actual tra
src/machine.rs:364
↓ 5 callers
Method
set_trans_logging
Sets whether transitions are logged to the console
src/machine.rs:342
↓ 3 callers
Function
clamped_value
[`value`] clamped to [-1, 1]
src/trigger/input.rs:50
↓ 3 callers
Method
trans_builder
Adds a transition builder to the state machine. When the entity is in `Prev` state, and `Trig` occurs, the given builder will be run on `Trig::Ok`. If
src/machine.rs:216
↓ 3 callers
Function
value
Trigger that transitions if the given [`Actionlike`]'s value is within the given bounds. Consider using `f32::NEG_INFINITY`/`f32::INFINITY` in the bou
src/trigger/input.rs:10
↓ 2 callers
Method
clone
(&self)
src/state.rs:94
↓ 2 callers
Function
plug
(schedule: Interned<dyn ScheduleLabel>)
src/machine.rs:20
↓ 2 callers
Method
trigger
(&self, entity: Entity, commands: &mut Commands)
src/state.rs:128
↓ 1 callers
Method
and
Combines these triggers by logical AND. Do not override.
src/trigger.rs:138
↓ 1 callers
Method
check
( &'a mut self, world: &World, entity: Entity, )
src/machine.rs:82
↓ 1 callers
Function
done
Trigger that transitions if the entity has the [`Done`] component. Provide `Some(Done::Variant)` to transition upon that particular variant, or `None`
src/trigger.rs:389
↓ 1 callers
Method
init
(&mut self, world: &mut World)
src/machine.rs:77
↓ 1 callers
Method
init_transitions
Initialize all transitions. Must be executed before `run`. This is separate because `run` is parallelizable (takes a `&World`) but this isn't (takes a
src/machine.rs:349
↓ 1 callers
Function
just_pressed
Trigger that transitions upon pressing the given [`Actionlike`]
src/trigger/input.rs:266
↓ 1 callers
Method
not
Negates the trigger. Do not override.
src/trigger.rs:126
↓ 1 callers
Function
value_unbounded
Unbounded [`value`]
src/trigger/input.rs:35
Function
action_data
Provides the given [`Actionlike`]'s [`ActionData`]
src/trigger/input.rs:314
Function
always
Trigger that always transitions
src/trigger.rs:260
Method
apply
(self, world: &mut World)
src/machine.rs:571
Function
axis_pair_length_bounds
[`axis_pair`] with only length bounds
src/trigger/input.rs:169
Function
axis_pair_max_length
[`axis_pair`] with only a maximum length bound
src/trigger/input.rs:161
Function
axis_pair_min_length
[`axis_pair`] with only a minimum length bound
src/trigger/input.rs:153
Function
axis_pair_rotation_bounds
[`axis_pair`] with only rotation bounds
src/trigger/input.rs:177
Function
axis_pair_unbounded
Unbounded [`axis_pair`]
src/trigger/input.rs:146
Method
build
(&self, app: &mut App)
src/lib.rs:39
Method
check
(&mut self, entity: Entity, world: &World)
src/trigger.rs:232
Function
clamped_axis_pair_length_bounds
[`clamped_axis_pair`] with only length bounds
src/trigger/input.rs:250
Function
clamped_axis_pair_max_length
[`clamped_axis_pair`] with only a maximum length bound
src/trigger/input.rs:242
Function
clamped_axis_pair_min_length
[`clamped_axis_pair`] with only a minimum length bound
src/trigger/input.rs:234
Function
clamped_axis_pair_rotation_bounds
[`clamped_axis_pair`] with only rotation bounds
src/trigger/input.rs:258
Function
clamped_axis_pair_unbounded
Unbounded [`clamped_axis_pair`]
src/trigger/input.rs:227
Function
clamped_value_max
[`clamped_value`] with only a maximum bound
src/trigger/input.rs:90
Function
clamped_value_min
[`clamped_value`] with only a minimum bound
src/trigger/input.rs:82
Function
clamped_value_unbounded
Unbounded [`clamped_value`]
src/trigger/input.rs:75
Function
click
( mouse: Res<ButtonInput<MouseButton>>, cursor_position: Res<CursorPosition>, )
examples/done.rs:36
Method
command_on_enter
Adds an on-enter command to the state machine. Whenever the state machine transitions from any previous state to the given next state, it will run the
src/machine.rs:314
Method
command_on_enter_to
Adds an on-enter command to the state machine. Whenever the state machine transitions from the given previous state to the given next state, it will r
src/machine.rs:298
Method
command_on_exit
Adds an on-exit command to the state machine. Whenever the state machine transitions from the given previous state to any next state, it will run the
src/machine.rs:337
Method
command_on_exit_from
Adds an on-exit command to the state machine. Whenever the state machine transitions from the given previous state to the given next state, it will ru
src/machine.rs:321
Method
default
()
src/machine.rs:175
Method
default
()
src/lib.rs:23
Function
fall
(mut fallings: Query<(&mut Transform, &mut Falling)>, time: Res<Time>)
examples/input.rs:103
Method
fmt
(&self, f: &mut std::fmt::Formatter<'_>)
src/machine.rs:61
Method
fmt
(&self, f: &mut Formatter<'_>)
src/state.rs:141
Function
follow
Let's define some behavior for entities in the follow state
examples/chase.rs:94
Method
from
(value: ErrList)
src/lib.rs:91
Method
from_entity
(_: Entity)
src/trigger.rs:53
Function
go_to_target
( mut commands: Commands, mut go_to_selections: Query<(Entity, &mut Transform, &GoToSelection)>, t
examples/done.rs:57
Function
grounded
(In(entity): In<Entity>, fallings: Query<(&Transform, &Falling)>)
examples/input.rs:74
Method
ignore_and
Combines these triggers by logical AND, discarding the output of the first. Do not override.
src/trigger.rs:157
Function
init
(mut commands: Commands, asset_server: Res<AssetServer>)
examples/done.rs:16
Function
init
(mut commands: Commands, asset_server: Res<AssetServer>)
examples/input.rs:22
Function
init
Setup the game
examples/chase.rs:17
Method
init
(&mut self, world: &mut World)
src/trigger.rs:228
Function
just_released
Trigger that transitions upon releasing the given [`Actionlike`]
src/trigger/input.rs:298
Function
main
()
examples/done.rs:7
Function
main
()
examples/input.rs:8
Function
main
()
examples/chase.rs:7
Method
matches
(state: TypeId)
src/state.rs:25
Method
metadata_mut
Get the metadata for the given state, creating it if necessary.
src/machine.rs:207
Function
move_player
( mut players: Query<&mut Transform, With<Player>>, keys: Res<ButtonInput<KeyCode>>, time: Res<Tim
examples/chase.rs:144
Function
near
(target: Entity)
examples/chase.rs:119
Method
new
(trigger: Trig, builder: Build)
src/machine.rs:116
Method
on_enter
Adds an on-enter event to the state machine. Whenever the state machine transitions from any previous state to the given next state, it will run the e
src/machine.rs:262
Method
on_enter_to
Adds an on-enter event to the state machine. Whenever the state machine transitions from the given previous state to the given next state, it will run
src/machine.rs:246
Method
on_exit
Adds an on-exit event to the state machine. Whenever the state machine transitions from the given previous state to any next state, it will run the ev
src/machine.rs:288
Method
on_exit_from
Adds an on-enter event to the state machine. Whenever the state machine transitions from the given previous state to the given next state, it will run
src/machine.rs:272
Function
on_message
Trigger that transitions when it receives the associated event
src/trigger.rs:400
Method
or
Combines these triggers by logical OR. Do not override.
src/trigger.rs:173
Function
plug
(schedule: Interned<dyn ScheduleLabel>)
src/trigger.rs:26
Function
pressed
Trigger that transitions while pressing the given [`Actionlike`]
src/trigger/input.rs:282
Method
remove
(entity: Entity, world: &mut World, _: TypeId)
src/state.rs:29
Function
remove_done_markers
(mut commands: Commands, dones: Query<Entity, With<Done>>)
src/trigger.rs:413
Function
resource_present
Triggers when `SomeResource` is present
src/machine.rs:486
Method
schedule
Sets the schedule in which `StateMachine`s are updated. Defaults to `PostUpdate`.
src/lib.rs:32
Function
test_command_event_matches
()
src/machine.rs:662
Function
test_event_matches
()
src/machine.rs:618
Function
test_machine
()
src/machine.rs:505
Function
test_self_transition
()
src/machine.rs:537
Function
test_sets_initial_state
()
src/machine.rs:491
Function
test_state_machine
()
src/machine.rs:558
Function
test_triggers
()
src/state.rs:185
Method
trans
Adds a transition to the state machine. When the entity is in the state given as a type parameter, and the given trigger occurs, it will transition to
src/machine.rs:198
Function
transition
Runs all transitions on all entities. There are comments here about parallelization, but this is not parallelized anymore. Leaving them here in case i
src/machine.rs:417
Function
update_cursor_position
( cameras: Query<(&Camera, &GlobalTransform)>, windows: Query<&Window>, mut position: ResMut<Curso
examples/done.rs:88
Function
value_max
[`value`] with only a maximum bound
src/trigger/input.rs:45
Function
value_min
[`value`] with only a minimum bound
src/trigger/input.rs:40
Function
walk
(mut groundeds: Query<(&mut Transform, &Grounded)>, time: Res<Time>)
examples/input.rs:95
Method
with_state
Registers a state. This is only necessary for states that are not used in any transitions.
src/machine.rs:189