<commit_before>package battleships.backend.classhelpers;

import battleships.backend.State;
import game.impl.BoardLocation;
import battleships.backend.Settings;

import java.util.List;

public class BoardHelper {

    private State state;

    public BoardHelper(State state){
        this.state = state;
    }

    public List<BoardLocation> getPlayerOneBoardHalf(){
        return state.getBoard().getLocations().subList(0, 99);
    }

    public List<BoardLocation> getPlayerTwoBoardHalf(){
        return state.getBoard().getLocations().subList(100, 199);
    }

    public BoardLocation findDeployPieceLocation(){
        List<BoardLocation> locations = state.getBoard().getLocations();

        for(int i = 0; i < locations.size(); i++){
            if(locations.get(i).getPiece() != null)
                if(locations.get(i).getPiece().getId().equals(Settings.DEPLOY_PIECE_ID))
                    return locations.get(i);
        }

        return null;
    }

}
<commit_msg>refactor<commit_after>package battleships.backend.classhelpers;

import battleships.backend.State;
import game.impl.BoardLocation;
import battleships.backend.Settings;

import java.util.List;

public class BoardHelper {

    private State state;

    public BoardHelper(State state){
        this.state = state;
    }

    public List<BoardLocation> getPlayerOneBoardHalf(){
        return state.getBoard().getLocations().subList(0, 100);
    }

    public List<BoardLocation> getPlayerTwoBoardHalf(){
        return state.getBoard().getLocations().subList(100, 200);
    }

    public BoardLocation findDeployPieceLocation(){
        List<BoardLocation> locations = state.getBoard().getLocations();

        for(int i = 0; i < locations.size(); i++){
            if(locations.get(i).getPiece() != null)
                if(locations.get(i).getPiece().getId().equals(Settings.DEPLOY_PIECE_ID))
                    return locations.get(i);
        }

        return null;
    }

}

{'fraction_non_alphanumeric': 0.12130479102956167, 'fraction_numerical': 0.010703363914373088, 'mean_word_length': 3.030800821355236, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, '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': '975397', 'n_tokens_mistral': 607, 'n_tokens_neox': 559, 'n_words': 104}