<commit_before>package com.cardshifter.api.config;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;

import com.cardshifter.api.outgoing.CardInfoMessage;

public class DeckConfig {

	private final Map<Integer, CardInfoMessage> cardData;
	private final Map<Integer, Integer> chosen = new HashMap<Integer, Integer>();
	private final Map<Integer, Integer> max = new HashMap<Integer, Integer>();
	private final int minSize;
	private final int maxSize;
	private final int maxPerCard;
	
	DeckConfig() {
		this(0, 0, new HashMap<Integer, CardInfoMessage>(), 0);
	}
	public DeckConfig(int minSize, int maxSize, Map<Integer, CardInfoMessage> cardData, int maxPerCard) {
		this.minSize = minSize;
		this.maxSize = maxSize;
		this.maxPerCard = maxPerCard;
		this.cardData = new HashMap<Integer, CardInfoMessage>(cardData);
	}
	
	public void setMax(int id, int max) {
		this.max.put(id, max);
	}
	
	public void setChosen(int id, int chosen) {
		this.chosen.put(id, chosen);
	}
	
	public void removeChosen(int id) {
		if (this.chosen.get(id) > 1) {
			this.setChosen(id, this.getChosen().get(id) - 1);
		} else {
			this.chosen.remove(id);
		}
	}
	
	public int getMinSize() {
		return minSize;
	}<commit_msg>added `getChosen(int id)` method to DeckConfig<commit_after>package com.cardshifter.api.config;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;

import com.cardshifter.api.outgoing.CardInfoMessage;

public class DeckConfig {

	private final Map<Integer, CardInfoMessage> cardData;
	private final Map<Integer, Integer> chosen = new HashMap<Integer, Integer>();
	private final Map<Integer, Integer> max = new HashMap<Integer, Integer>();
	private final int minSize;
	private final int maxSize;
	private final int maxPerCard;
	
	DeckConfig() {
		this(0, 0, new HashMap<Integer, CardInfoMessage>(), 0);
	}
	public DeckConfig(int minSize, int maxSize, Map<Integer, CardInfoMessage> cardData, int maxPerCard) {
		this.minSize = minSize;
		this.maxSize = maxSize;
		this.maxPerCard = maxPerCard;
		this.cardData = new HashMap<Integer, CardInfoMessage>(cardData);
	}
	
	public void setMax(int id, int max) {
		this.max.put(id, max);
	}
	
	public void setChosen(int id, int chosen) {
		this.chosen.put(id, chosen);
	}
	
	public int getChosen(int id) {
		Integer chosen = this.chosen.get(id);
		return chosen == null ? 0 : chosen;
	}

	public void removeChosen(int id) {
		if (this.chosen.get(id) > 1) {
			this.setChosen(id, this.getChosen().get(id) - 1);
		} else {
			this.chosen.remove(id);
		}
	}
	
	public int getMinSize() {
		return minSize;
	}
{'fraction_non_alphanumeric': 0.12259003273917789, 'fraction_numerical': 0.004001455074572572, 'mean_word_length': 4.555555555555555, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 21, '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': '3524542', 'n_tokens_mistral': 1003, 'n_tokens_neox': 935, 'n_words': 241}