<commit_before>const Coordinate = require(__dirname + '/coordinate');

module.exports = class Ship {
    constructor() {
        this.coordinates = [];
        this.hitCoordinates = [];
    }

    addCoordinate(coordinate) {
        this.coordinates.push(coordinate);
    }

    removeCoordinate(coordinate) {
        this.coordinates = this.coordinates.filter(
            (otherCoordinate) => { return !Coordinate.equal(otherCoordinate, coordinate); });
    }

    addHitCoordinate(possibleHit){
        this.coordinates.forEach(coordinate => {
            if(Coordinate.equal(possibleHit, coordinate)){
                this.hitCoordinates.push(Coordinate.copy(possibleHit));
            }
        });
    }

    isDestroyed(){
        return this.coordinates.length <= this.hitCoordinates.length;
    }

    hasCoordinates() {
        return this.coordinates.length > 0;
    }

    get allCoordinates() {
        return this.coordinates;
    }
};<commit_msg>Private Attribute haben nun ein _ vor dem Namen<commit_after>const coordinate = require(__dirname + '/coordinate');

module.exports = class Ship {
    constructor() {
        this._coordinates = [];
        this._hitCoordinates = [];
    }

    addCoordinate(coordinate) {
        this._coordinates.push(coordinate);
    }

    removeCoordinate(coordinate) {
        this._coordinates = this._coordinates.filter(
            (otherCoordinate) => { return !coordinate.equal(otherCoordinate, coordinate); });
    }

    addHitCoordinate(possibleHit){
        this._coordinates.forEach(coordinate => {
            if(coordinate.equal(possibleHit, coordinate)){
                this._hitCoordinates.push(coordinate.copy(possibleHit));
            }
        });
    }

    isDestroyed(){
        return this._coordinates.length <= this._hitCoordinates.length;
    }

    hasCoordinates() {
        return this._coordinates.length > 0;
    }

    get allCoordinates() {
        return this._coordinates;
    }
};
{'fraction_non_alphanumeric': 0.11794611082867311, 'fraction_numerical': 0.0010167768174885613, 'mean_word_length': 2.5080213903743314, 'pattern_counts': {'":': 0, '<': 5, '<?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': '5082585', 'n_tokens_mistral': 550, 'n_tokens_neox': 521, 'n_words': 79}