<commit_before>package net.edralzar.wargolem;

import net.edralzar.wargolem.model.MapResource;
import net.edralzar.wargolem.model.Player;
import net.edralzar.wargolem.model.Role;
import net.edralzar.wargolem.model.WarRoom;

public class Golem {

    private WarRoom room;

    public Golem(WarRoom room) {
        if (room == null)
            throw new NullPointerException();
        this.room = room;
    }

    public void addPlayer(Player p) {
        room.getSquad().add(p);
        p.setRole(Role.SOLDIER);
    }

    public void setScout(Player p, MapResource mr) {
        room.getScouts().forcePut(mr, p);
        p.setRole(Role.SCOUT);
    }
}<commit_msg>reset role when replacing scout + getter on WarRoom<commit_after>package net.edralzar.wargolem;

import net.edralzar.wargolem.model.MapResource;
import net.edralzar.wargolem.model.Player;
import net.edralzar.wargolem.model.Role;
import net.edralzar.wargolem.model.WarRoom;

public class Golem {

    private WarRoom room;

    public Golem(WarRoom room) {
        if (room == null)
            throw new NullPointerException();
        this.room = room;
    }

    public void addPlayer(Player p) {
        room.getSquad().add(p);
        p.setRole(Role.SOLDIER);
    }

    public void setScout(Player p, MapResource mr) {
        Player oldScout = room.getScouts().forcePut(mr, p);
        p.setRole(Role.SCOUT);
        if (oldScout != null)
            oldScout.setRole(Role.SOLDIER);
    }

    public WarRoom getWarRoom() {
        return room;
    }
}
{'fraction_non_alphanumeric': 0.1115485564304462, 'fraction_numerical': 0.0, 'mean_word_length': 2.746928746928747, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7549959', 'n_tokens_mistral': 550, 'n_tokens_neox': 523, 'n_words': 102}