<commit_before>package de.hbt.hackathon.rtb.strategy;

import java.util.ArrayList;
import java.util.EnumSet;
import java.util.List;
import java.util.Set;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import de.hbt.hackathon.rtb.base.geo.GeometricSet;
import de.hbt.hackathon.rtb.base.message.AngleType;
import de.hbt.hackathon.rtb.base.message.output.AccelerateMessage;
import de.hbt.hackathon.rtb.base.message.output.BrakeMessage;
import de.hbt.hackathon.rtb.base.message.output.OutputMessage;
import de.hbt.hackathon.rtb.base.message.output.RotateAmountMessage;
import de.hbt.hackathon.rtb.base.strategy.AbstractStrategy;
import de.hbt.hackathon.rtb.world.Cookie;
import de.hbt.hackathon.rtb.world.Mine;
import de.hbt.hackathon.rtb.world.MyRobot;
import de.hbt.hackathon.rtb.world.Robot;
import de.hbt.hackathon.rtb.world.World;

public class HealingStrategy extends AbstractStrategy {

	private static final Logger LOGGER = LoggerFactory.getLogger(SimpleStrategy.class);

	private final String NAME = "Healing";

	private final World world;

	public HealingStrategy(World world) {
		this.world = world;
	}

	@Override
	public List<OutputMessage> process() {
		List<OutputMessage> messages = new ArrayList<OutputMessage>();

		MyRobot myRobot = world.getMyRobot();
		Set<Cookie> cookies = world.getCookies();
		GeometricSet<Mine> mines = world.getMines();
		GeometricSet<Robot> robots = world.getRobots();
		if (!cookies.isEmpty()) {
			LOGGER.info("There are cookies!");
			if (myRobot != null) {
				Cookie cookie = cookies.iterator().next();
				Targeter targeter = new Targeter();
				targeter.driveTo(myRobot, cookie.getCurrentPosition());
			}
		} else if (!mines.isEmpty()) {
			LOGGER.info("There are mines!");
			if (myRobot != null) {
				Mine mine = mines.iterator().next();
				Targeter targeter = new Targeter();
				targeter.aimCannonToAndShoot(myRobot, mine.getCurrentPosition());
			}
		} else if (!robots.isEmpty()) {
			LOGGER.info("There are robots!");
			if (myRobot != null) {
				Robot robot = robots.iterator().next();
				Targeter targeter = new Targeter();
				targeter.aimCannonToAndShoot(myRobot, robot.getCurrentPosition());
			}
		} else {<commit_msg>aim always on<commit_after>package de.hbt.hackathon.rtb.strategy;

import java.util.ArrayList;
import java.util.EnumSet;
import java.util.List;
import java.util.Set;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import de.hbt.hackathon.rtb.base.geo.GeometricSet;
import de.hbt.hackathon.rtb.base.message.AngleType;
import de.hbt.hackathon.rtb.base.message.output.AccelerateMessage;
import de.hbt.hackathon.rtb.base.message.output.BrakeMessage;
import de.hbt.hackathon.rtb.base.message.output.OutputMessage;
import de.hbt.hackathon.rtb.base.message.output.RotateAmountMessage;
import de.hbt.hackathon.rtb.base.strategy.AbstractStrategy;
import de.hbt.hackathon.rtb.world.Cookie;
import de.hbt.hackathon.rtb.world.Mine;
import de.hbt.hackathon.rtb.world.MyRobot;
import de.hbt.hackathon.rtb.world.Robot;
import de.hbt.hackathon.rtb.world.World;

public class HealingStrategy extends AbstractStrategy {

	private static final Logger LOGGER = LoggerFactory.getLogger(SimpleStrategy.class);

	private final String NAME = "Healing";

	private final World world;

	public HealingStrategy(World world) {
		this.world = world;
	}

	@Override
	public List<OutputMessage> process() {
		List<OutputMessage> messages = new ArrayList<OutputMessage>();

		MyRobot myRobot = world.getMyRobot();
		Set<Cookie> cookies = world.getCookies();
		GeometricSet<Mine> mines = world.getMines();
		GeometricSet<Robot> robots = world.getRobots();
		if (!cookies.isEmpty()) {
			LOGGER.info("There are cookies!");
			if (myRobot != null) {
				Cookie cookie = cookies.iterator().next();
				Targeter targeter = new Targeter();
				targeter.driveTo(myRobot, cookie.getCurrentPosition());
			}
		} 
		
		if (!mines.isEmpty()) {
			LOGGER.info("There are mines!");
			if (myRobot != null) {
				Mine mine = mines.iterator().next();
				Targeter targeter = new Targeter();
				targeter.aimCannonToAndShoot(myRobot, mine.getCurrentPosition());
			}
		} else if (!robots.isEmpty()) {
			LOGGER.info("There are robots!");
			if (myRobot != null) {
				Robot robot = robots.iterator().next();
				Targeter targeter = new Targeter();
				targeter.aimCannonToAndShoot(myRobot, robot.getCurrentPosition());
			}
		} else {
{'fraction_non_alphanumeric': 0.13299931678433158, 'fraction_numerical': 0.0009109542245502164, 'mean_word_length': 4.689119170984456, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3635924', 'n_tokens_mistral': 1633, 'n_tokens_neox': 1512, 'n_words': 275}