import the woofer
This commit is contained in:
parent
825fee53e2
commit
3e89acfea8
92 changed files with 5783 additions and 0 deletions
25
addons/godot_state_charts/atomic_state.gd
Normal file
25
addons/godot_state_charts/atomic_state.gd
Normal file
|
@ -0,0 +1,25 @@
|
|||
@tool
|
||||
@icon("atomic_state.svg")
|
||||
## This is a state that has no sub-states.
|
||||
class_name AtomicState
|
||||
extends StateChartState
|
||||
|
||||
func _handle_transition(transition:Transition, source:StateChartState):
|
||||
# resolve the target state
|
||||
var target = transition.resolve_target()
|
||||
if not target is StateChartState:
|
||||
push_error("The target state '" + str(transition.to) + "' of the transition from '" + source.name + "' is not a state.")
|
||||
return
|
||||
# atomic states cannot transition, so we need to ask the parent
|
||||
# ask the parent
|
||||
get_parent()._handle_transition(transition, source)
|
||||
|
||||
|
||||
func _get_configuration_warnings() -> PackedStringArray :
|
||||
var warnings = super._get_configuration_warnings()
|
||||
# check if we have any child nodes which are not transitions
|
||||
for child in get_children():
|
||||
if child is StateChartState:
|
||||
warnings.append("Atomic states cannot have child states. These will be ignored.")
|
||||
break
|
||||
return warnings
|
Loading…
Add table
Add a link
Reference in a new issue