mirror of
https://github.com/vlang/v.git
synced 2025-09-13 14:32:26 +03:00
datatypes.fsm: cleanup notices for fsm.v
This commit is contained in:
parent
94d288197e
commit
5306469712
1 changed files with 11 additions and 4 deletions
|
@ -4,17 +4,24 @@ pub type EventHandlerFn = fn (receiver voidptr, from string, to string)
|
|||
|
||||
pub type ConditionFn = fn (receiver voidptr, from string, to string) bool
|
||||
|
||||
fn dummy_event_handler_fn(receiver voidptr, from string, to string) {
|
||||
}
|
||||
|
||||
fn dummy_condition_fn(receiver voidptr, from string, to string) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
struct State {
|
||||
mut:
|
||||
entry_handler EventHandlerFn
|
||||
run_handler EventHandlerFn
|
||||
exit_handler EventHandlerFn
|
||||
entry_handler EventHandlerFn = dummy_event_handler_fn
|
||||
run_handler EventHandlerFn = dummy_event_handler_fn
|
||||
exit_handler EventHandlerFn = dummy_event_handler_fn
|
||||
}
|
||||
|
||||
struct Transition {
|
||||
mut:
|
||||
to string
|
||||
condition_handler ConditionFn = unsafe { nil }
|
||||
condition_handler ConditionFn = dummy_condition_fn
|
||||
}
|
||||
|
||||
pub struct StateMachine {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue