@Override
	public BakingActionResult checkActionIsApplicableInState(State state, String[] params) {
		BakingActionResult superResult = super.checkActionIsApplicableInState(state, params);
		
		if (!superResult.getIsSuccess()) {
			return superResult;
		}
		
		String spaceName = params[2];
		ObjectInstance space = state.getObject(spaceName);
		String agentName = SpaceFactory.getAgent(space).iterator().next();
		String paramAgentName = params[0];
		if (!agentName.isEmpty() && !agentName.equalsIgnoreCase(paramAgentName)) {
			return BakingActionResult.failure(paramAgentName + " cannot move objects to the " + spaceName);
		}
		
		String containerName = params[1];
		ObjectInstance container = state.getObject(containerName);
		if (ContainerFactory.getSpaceName(container).equals(spaceName)) {
			return BakingActionResult.failure(containerName + " is already in " + spaceName);
		}
		
		if (SpaceFactory.isBaking(space) && !ContainerFactory.isBakingContainer(container)) {
			return BakingActionResult.failure(spaceName + " can only contain baking containers");
		}
		
		if (SpaceFactory.isHeating(space) && !ContainerFactory.isHeatingContainer(container)) {
			return BakingActionResult.failure(spaceName + " can only contain heating containers");
		}
		
		return BakingActionResult.success();		
	}