add method

StateMachine add(
  1. String id,
  2. State? state
)

Adds a new state with the given ID to the state machine.

Implementation

StateMachine add(String id, State? state ) {//State?
	if ( state is State ) {
		states[id] = state;
	}
    else {
		yukaConsole.warning( 'YUKA.StateMachine: .add() needs a parameter of type "YUKA.State".' );
	}

	return this;
}