game-ai/src/main/java/com/jzy/game/ai/fsm/DefaultStateMachine.java
/**
	 * Handles received telegrams. The telegram is first routed to the current
	 * state. If the current state does not deal with the message, it's routed to
	 * the global state's message handler.
	 * 
	 * @param telegram
	 *            the received telegram
	 * @return true if telegram has been successfully handled; false otherwise.
	 */
Handles received telegrams. The telegram is first routed to the current
state. If the current state does not deal with the message, it's routed to
the global state's message handler.

@param telegram
the received telegram
@return true if telegram has been successfully handled; false otherwise.
Handles received telegrams . The telegram is first routed to the current state . If the current state does not deal with the message it ' s routed to the global state ' s message handler . @param telegram the received telegram @return true if telegram has been successfully handled ; false otherwise .
@Override
	public boolean handleMessage(Telegram telegram) {
		if (currentState != null && currentState.onMessage(owner, telegram)) {
			return true;
		}
		if (globalState != null && globalState.onMessage(owner, telegram)) {
			return true;
		}
		return false;
	}
@ Override public boolean handleMessage ( Telegram telegram ) { if ( currentState != null && currentState . onMessage ( owner , telegram ) ) { return true ; } if ( globalState != null && globalState . onMessage ( owner , telegram ) ) { return true ; } return false ; }
Handles received telegrams.
Handles received telegrams .
// First see if the current state is valid and that it can handle the message // If not, and if a global state has been implemented, send // the message to the global state