Vast improvements and a working finite state machine, working on new guild member registration.
This commit is contained in:
23
fsm/machines/receptionist.gd
Normal file
23
fsm/machines/receptionist.gd
Normal file
@@ -0,0 +1,23 @@
|
||||
extends StateMachine
|
||||
|
||||
|
||||
func advance_state() -> void:
|
||||
var last_state = curr_state
|
||||
var args : Array = [actor]
|
||||
exit_state(curr_state)
|
||||
match(last_state.name):
|
||||
"Wait":
|
||||
if last_state.next_state != "":
|
||||
if !states.has(last_state.next_state):
|
||||
printerr("Tried to switch to missing state %s" % last_state.next_state)
|
||||
pass
|
||||
enter_state(states[last_state.next_state])
|
||||
args.append_array(last_state.next_state_args)
|
||||
else:
|
||||
pass
|
||||
"Advance Queue":
|
||||
enter_state(states["Wait"])
|
||||
args.append_array(["", "Advance Queue"])
|
||||
|
||||
if curr_state != null:
|
||||
curr_state.execute.callv(args)
|
||||
Reference in New Issue
Block a user