public override void step()
    {
        if (currentState == null)
            currentState = listState[0];

        if (currentState.getTarget() == null)
            currentState.setTarget(currentTarget);

        currentState.step();

        StateJordan temp = currentState.check();

        if (temp != null)
            currentState = temp;
    }
 public StateMachineJordan(List<StateJordan> list, StateJordan initState)
 {
     currentState = initState;
     listState = list;
 }
 public void setNextState(StateJordan state)
 {
     if (state != null)
         nextState = state;
 }