return logger;
}
public FSMState onRefereeHearMessage(RefereeHearMessage messsage) {
RefereeHearMessage refereemessage = (RefereeHearMessage) messsage;
messsage = (RefereeHearMessage) messsage;
if (refereemessage.getRefereeMessage() == RefereeHearMessage.RefereMessages.PLAY_ON) {
setFreeCommandCycle(false);
return playModeHandler.onPLAY_ON();
}
if (refereemessage.getRefereeMessage() == RefereeHearMessage.RefereMessages.DROP_BALL) {
setFreeCommandCycle(true);
return playModeHandler.onDROP_BALL();
}
if (refereemessage.getRefereeMessage() == RefereeHearMessage.RefereMessages.HALF_TIME) {
setFreeCommandCycle(true);
return playModeHandler.onHALF_TIME();
}
if (refereemessage.getRefereeMessage() == RefereeHearMessage.RefereMessages.TIME_UP) {
setFreeCommandCycle(true);
return playModeHandler.onTIME_UP();
}
if (refereemessage.getRefereeMessage() == RefereeHearMessage.RefereMessages.TIME_EXTENDED) {
setFreeCommandCycle(true);
return playModeHandler.onTIME_EXTENDED();
}
if (refereemessage.getRefereeMessage() == RefereeHearMessage.RefereMessages.TIME_OVER) {
setFreeCommandCycle(true);
return playModeHandler.onTIME_OVER();
}
if (refereemessage.getRefereeMessage() == RefereeHearMessage.RefereMessages.BEFORE_KICK_OFF) {
setFreeCommandCycle(false);
return playModeHandler.onBEFORE_KICK_OFF();
}
if (mySide == TeamSide.LEFT) {
if (refereemessage.getRefereeMessage() == RefereeHearMessage.RefereMessages.KICK_OFF_L) {
setFreeCommandCycle(false);
return playModeHandler.onKICK_OFF_US();
}
if (refereemessage.getRefereeMessage() == RefereeHearMessage.RefereMessages.KICK_OFF_R) {
setFreeCommandCycle(false);
return playModeHandler.onKICK_OFF_THEM();
}
if (refereemessage.getRefereeMessage() == RefereeHearMessage.RefereMessages.GOAL_L) {
setFreeCommandCycle(true);
return playModeHandler.onGOAL_THEM();
}
if (refereemessage.getRefereeMessage() == RefereeHearMessage.RefereMessages.GOAL_R) {
setFreeCommandCycle(true);
return playModeHandler.onGOAL_US();
}
if (refereemessage.getRefereeMessage() == RefereeHearMessage.RefereMessages.KICK_IN_R) {
setFreeCommandCycle(false);
return playModeHandler.onKICK_IN_THEM();
}
if (refereemessage.getRefereeMessage() == RefereeHearMessage.RefereMessages.KICK_IN_L) {
setFreeCommandCycle(false);
return playModeHandler.onKICK_IN_US();
}
if (refereemessage.getRefereeMessage() == RefereeHearMessage.RefereMessages.GOAL_KICK_R) {
setFreeCommandCycle(false);
return playModeHandler.onGOAL_KICK_THEM();
}
if (refereemessage.getRefereeMessage() == RefereeHearMessage.RefereMessages.GOAL_KICK_L) {
setFreeCommandCycle(false);
return playModeHandler.onGOAL_KICK_US();
}
if (refereemessage.getRefereeMessage() == RefereeHearMessage.RefereMessages.FREE_KICK_L) {
setFreeCommandCycle(false);
return playModeHandler.onFREE_KICK_US();
}
if (refereemessage.getRefereeMessage() == RefereeHearMessage.RefereMessages.FREE_KICK_R) {
setFreeCommandCycle(false);
return playModeHandler.onFREE_KICK_THEM();
}
if (refereemessage.getRefereeMessage() == RefereeHearMessage.RefereMessages.CORNER_KICK_R) {
setFreeCommandCycle(false);
return playModeHandler.onCORNER_KICK_THEM();
}
if (refereemessage.getRefereeMessage() == RefereeHearMessage.RefereMessages.CORNER_KICK_L) {
setFreeCommandCycle(false);
return playModeHandler.onCORNER_KICK_US();
}
if (refereemessage.getRefereeMessage() == RefereeHearMessage.RefereMessages.FREE_KICK_L_FAULT) {
setFreeCommandCycle(false);
return playModeHandler.onFREE_KICK_US_FAULT();
}
if (refereemessage.getRefereeMessage() == RefereeHearMessage.RefereMessages.FREE_KICK_R_FAULT) {
setFreeCommandCycle(false);
return playModeHandler.onFREE_KICK_THEM_FAULT();
}
if (refereemessage.getRefereeMessage() == RefereeHearMessage.RefereMessages.OFFSIDE_LEFT) {
setFreeCommandCycle(false);
return playModeHandler.onOFFSIDE_US();
}
if (refereemessage.getRefereeMessage() == RefereeHearMessage.RefereMessages.OFFSIDE_RIGHT) {
setFreeCommandCycle(false);
return playModeHandler.onOFFSIDE_THEM();
}
if (refereemessage.getRefereeMessage() == RefereeHearMessage.RefereMessages.GOALIE_CATCH_BALL_LEFT) {
setFreeCommandCycle(false);
return playModeHandler.onGOALIE_CATCH_BALL_US();
}
if (refereemessage.getRefereeMessage() == RefereeHearMessage.RefereMessages.GOALIE_CATCH_BALL_RIGHT) {
setFreeCommandCycle(false);
return playModeHandler.onGOALIE_CATCH_BALL_THEM();
}
if (refereemessage.getRefereeMessage() == RefereeHearMessage.RefereMessages.FOUL_LEFT) {
setFreeCommandCycle(false);
return playModeHandler.onFOUL_US();
}
if (refereemessage.getRefereeMessage() == RefereeHearMessage.RefereMessages.FOUL_RIGHT) {
setFreeCommandCycle(false);
return playModeHandler.onFOUL_THEM();
}
}
if (mySide == TeamSide.RIGHT) {
if (refereemessage.getRefereeMessage() == RefereeHearMessage.RefereMessages.KICK_OFF_L) {
setFreeCommandCycle(false);
return playModeHandler.onKICK_OFF_THEM();
}
if (refereemessage.getRefereeMessage() == RefereeHearMessage.RefereMessages.KICK_OFF_R) {
setFreeCommandCycle(false);
return playModeHandler.onKICK_OFF_US();
}
if (refereemessage.getRefereeMessage() == RefereeHearMessage.RefereMessages.GOAL_L) {
setFreeCommandCycle(true);
return playModeHandler.onGOAL_US();
}
if (refereemessage.getRefereeMessage() == RefereeHearMessage.RefereMessages.GOAL_R) {
setFreeCommandCycle(true);
return playModeHandler.onGOAL_THEM();
}
if (refereemessage.getRefereeMessage() == RefereeHearMessage.RefereMessages.KICK_IN_R) {
setFreeCommandCycle(false);
return playModeHandler.onKICK_IN_US();
}
if (refereemessage.getRefereeMessage() == RefereeHearMessage.RefereMessages.KICK_IN_L) {
setFreeCommandCycle(false);
return playModeHandler.onKICK_IN_THEM();
}
if (refereemessage.getRefereeMessage() == RefereeHearMessage.RefereMessages.GOAL_KICK_R) {
setFreeCommandCycle(false);
return playModeHandler.onGOAL_KICK_US();
}
if (refereemessage.getRefereeMessage() == RefereeHearMessage.RefereMessages.GOAL_KICK_L) {
setFreeCommandCycle(false);
return playModeHandler.onGOAL_KICK_THEM();
}
if (refereemessage.getRefereeMessage() == RefereeHearMessage.RefereMessages.FREE_KICK_L) {
setFreeCommandCycle(false);
return playModeHandler.onFREE_KICK_THEM();
}
if (refereemessage.getRefereeMessage() == RefereeHearMessage.RefereMessages.FREE_KICK_R) {
setFreeCommandCycle(false);
return playModeHandler.onFREE_KICK_US();
}
if (refereemessage.getRefereeMessage() == RefereeHearMessage.RefereMessages.CORNER_KICK_R) {
setFreeCommandCycle(false);
return playModeHandler.onCORNER_KICK_US();
}
if (refereemessage.getRefereeMessage() == RefereeHearMessage.RefereMessages.CORNER_KICK_L) {
setFreeCommandCycle(false);
return playModeHandler.onCORNER_KICK_THEM();
}
if (refereemessage.getRefereeMessage() == RefereeHearMessage.RefereMessages.FREE_KICK_L_FAULT) {
setFreeCommandCycle(false);
return playModeHandler.onFREE_KICK_THEM_FAULT();
}
if (refereemessage.getRefereeMessage() == RefereeHearMessage.RefereMessages.FREE_KICK_R_FAULT) {
setFreeCommandCycle(false);
return playModeHandler.onFREE_KICK_US_FAULT();
}
if (refereemessage.getRefereeMessage() == RefereeHearMessage.RefereMessages.OFFSIDE_LEFT) {
setFreeCommandCycle(false);
return playModeHandler.onOFFSIDE_THEM();
}
if (refereemessage.getRefereeMessage() == RefereeHearMessage.RefereMessages.OFFSIDE_RIGHT) {
setFreeCommandCycle(false);
return playModeHandler.onOFFSIDE_US();
}
if (refereemessage.getRefereeMessage() == RefereeHearMessage.RefereMessages.GOALIE_CATCH_BALL_LEFT) {
setFreeCommandCycle(false);
return playModeHandler.onGOALIE_CATCH_BALL_THEM();
}
if (refereemessage.getRefereeMessage() == RefereeHearMessage.RefereMessages.GOALIE_CATCH_BALL_RIGHT) {
setFreeCommandCycle(false);
return playModeHandler.onGOALIE_CATCH_BALL_US();
}
if (refereemessage.getRefereeMessage() == RefereeHearMessage.RefereMessages.FOUL_LEFT) {
setFreeCommandCycle(false);
return playModeHandler.onFOUL_THEM();
}
if (refereemessage.getRefereeMessage() == RefereeHearMessage.RefereMessages.FOUL_RIGHT) {
setFreeCommandCycle(false);
return playModeHandler.onFOUL_US();
}
}
return myState;