<commit_before>package com.kduda.battleships.models.units;

import java.util.ArrayList;

public enum UnitFactory {
    INSTANCE;
    ArrayList<Unit> units;

    UnitFactory() {
        units = new ArrayList<>();
        units.add(createGroundLevelUnit(UnitType.Ship, 4));

        units.add(createGroundLevelUnit(UnitType.Ship, 3));
        units.add(createGroundLevelUnit(UnitType.Ship, 3));

        units.add(createGroundLevelUnit(UnitType.Ship, 2));
        units.add(createGroundLevelUnit(UnitType.Ship, 2));
        units.add(createGroundLevelUnit(UnitType.Ship, 2));

        units.add(createGroundLevelUnit(UnitType.Ship, 1));
        units.add(createGroundLevelUnit(UnitType.Ship, 1));
        units.add(createGroundLevelUnit(UnitType.Ship, 1));

        units.add(createGroundLevelUnit(UnitType.Tank, 4));

        units.add(createGroundLevelUnit(UnitType.Tank, 3));
        units.add(createGroundLevelUnit(UnitType.Tank, 3));

        units.add(createGroundLevelUnit(UnitType.Tank, 2));
        units.add(createGroundLevelUnit(UnitType.Tank, 2));
        units.add(createGroundLevelUnit(UnitType.Tank, 2));

        units.add(createPlane());
        units.add(createPlane());
        units.add(createPlane());
    }

    public Unit createNextUnit() {

        return null;
    }

    Unit createGroundLevelUnit(UnitType type, int size) {
        switch (type) {
            case Ship:
                return new Ship(size);
            case Tank:
                return new Tank(size);
        }
        return null;
    }

    Unit createPlane() {
        return new Plane();
    }
}
<commit_msg>Add ctor with units list initialization<commit_after>package com.kduda.battleships.models.units;

import java.util.ArrayList;

public enum UnitFactory {
    INSTANCE;
    ArrayList<Unit> units;

    UnitFactory() {
        initializeUnitsList();
    }

    public void initializeUnitsList() {
        units = new ArrayList<>();
        units.add(createGroundLevelUnit(UnitType.Ship, 4));

        units.add(createGroundLevelUnit(UnitType.Ship, 3));
        units.add(createGroundLevelUnit(UnitType.Ship, 3));

        units.add(createGroundLevelUnit(UnitType.Ship, 2));
        units.add(createGroundLevelUnit(UnitType.Ship, 2));
        units.add(createGroundLevelUnit(UnitType.Ship, 2));

        units.add(createGroundLevelUnit(UnitType.Ship, 1));
        units.add(createGroundLevelUnit(UnitType.Ship, 1));
        units.add(createGroundLevelUnit(UnitType.Ship, 1));

        units.add(createGroundLevelUnit(UnitType.Tank, 4));

        units.add(createGroundLevelUnit(UnitType.Tank, 3));
        units.add(createGroundLevelUnit(UnitType.Tank, 3));

        units.add(createGroundLevelUnit(UnitType.Tank, 2));
        units.add(createGroundLevelUnit(UnitType.Tank, 2));
        units.add(createGroundLevelUnit(UnitType.Tank, 2));

        units.add(createPlane());
        units.add(createPlane());
        units.add(createPlane());
    }

    public Unit createNextUnit() {

        return null;
    }

    Unit createGroundLevelUnit(UnitType type, int size) {
        switch (type) {
            case Ship:
                return new Ship(size);
            case Tank:
                return new Tank(size);
        }
        return null;
    }

    Unit createPlane() {
        return new Plane();
    }
}

{'fraction_non_alphanumeric': 0.11950632149307645, 'fraction_numerical': 0.009030704394942806, 'mean_word_length': 2.737907761529809, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '1213742', 'n_tokens_mistral': 1070, 'n_tokens_neox': 1022, 'n_words': 161}