<commit_before>package com.miloshpetrov.sol2.game;

import com.badlogic.gdx.utils.JsonValue;
import com.miloshpetrov.sol2.game.ship.HullConfig;
import com.miloshpetrov.sol2.game.ship.HullConfigs;

import java.util.ArrayList;

public class ShipConfig {
  public final HullConfig hull;
  public final String items;
  public final float density;

  public ShipConfig(HullConfig hull, String items, float density) {
    this.hull = hull;
    this.items = items;
    this.density = density;
  }

  public static ArrayList<ShipConfig> loadList(JsonValue shipListJson, HullConfigs hullConfigs) {
    ArrayList<ShipConfig> res = new ArrayList<ShipConfig>();
    for (JsonValue shipNode : shipListJson) {
      ShipConfig c = load(hullConfigs, shipNode);
      res.add(c);
    }
    return res;
  }

  public static ShipConfig load(HullConfigs hullConfigs, JsonValue shipNode) {
    String hullName = shipNode.getString("hull");
    HullConfig hull = hullConfigs.getConfig(hullName);
    String items = shipNode.getString("items");
    float density = shipNode.hasChild("density") ? shipNode.getFloat("density") : -1;
    return new ShipConfig(hull, items, density);
  }
}<commit_msg>no enemies fix<commit_after>package com.miloshpetrov.sol2.game;

import com.badlogic.gdx.utils.JsonValue;
import com.miloshpetrov.sol2.game.ship.HullConfig;
import com.miloshpetrov.sol2.game.ship.HullConfigs;

import java.util.ArrayList;

public class ShipConfig {
  public final HullConfig hull;
  public final String items;
  public final float density;

  public ShipConfig(HullConfig hull, String items, float density) {
    this.hull = hull;
    this.items = items;
    this.density = density;
  }

  public static ArrayList<ShipConfig> loadList(JsonValue shipListJson, HullConfigs hullConfigs) {
    ArrayList<ShipConfig> res = new ArrayList<ShipConfig>();
    for (JsonValue shipNode : shipListJson) {
      ShipConfig c = load(hullConfigs, shipNode);
      res.add(c);
    }
    return res;
  }

  public static ShipConfig load(HullConfigs hullConfigs, JsonValue shipNode) {
    String hullName = shipNode.getString("hull");
    HullConfig hull = hullConfigs.getConfig(hullName);
    String items = shipNode.getString("items");
    float density = shipNode.getFloat("density", -1);
    return new ShipConfig(hull, items, density);
  }
}
{'fraction_non_alphanumeric': 0.10176800344976283, 'fraction_numerical': 0.0034497628288055198, 'mean_word_length': 4.284738041002278, 'pattern_counts': {'":': 0, '<': 9, '<?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': '6535317', 'n_tokens_mistral': 747, 'n_tokens_neox': 731, 'n_words': 173}