@Override
	public void onTakeStep()
	{
		
//		_players[0].setBehaviour(_behaviours[1]);

		Queue<Message> messagelist = getTrainerMessages();
		while (!messagelist.isEmpty()){
			Message message = messagelist.poll();
			if (message instanceof MessageEvent) {
				MessageEvent messageEvent = (MessageEvent) message;
				if (messageEvent.getEventText().equals("Portero bloqueado") && _players[4].getBehaviour() != _behaviours[0]) {
					_players[4].setBehaviour(_behaviours[0]);
					Goalkeeper secondGoalkeeper = (Goalkeeper) _players[4].getBehaviour();
					secondGoalkeeper.setSecondGoalkeeper(true);
				} else if (messageEvent.getEventText().equals("Portero libre") && _players[4].getBehaviour() != _behaviours[2]) {
					_players[4].setBehaviour(_behaviours[2]);
				} else if (messageEvent.getEventText().equals("Delantero bloqueado")) {
					_players[2].setBehaviour(_behaviours[2]);
				}
			}
		}			
	}