Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * 艦娘を作成します
- *
- * @param object
- * @return
- */
- private static ShipInfoDto toShipInfoDto(JsonObject object, String id) {
- String name = object.getString("api_name");
- if ("なし".equals(name)) {
- return ShipInfoDto.EMPTY;
- }
- String type = ShipStyle.get(object.getJsonNumber("api_stype").toString());
- //Change starts here
- ShipInfoDto d = Ship.get(id);
- if (d != null) {
- name = d.getName();
- type = d.getType();
- }
- //Change ends here
- String flagship = object.getString("api_yomi");
- if ("-".equals(flagship)) {
- flagship = "";
- }
- int afterlv = object.getJsonNumber("api_afterlv").intValue();
- int maxBull = 0;
- if (object.containsKey("api_bull_max")) {
- maxBull = object.getJsonNumber("api_bull_max").intValue();
- }
- int maxFuel = 0;
- if (object.containsKey("api_fuel_max")) {
- maxFuel = object.getJsonNumber("api_fuel_max").intValue();
- }
- return new ShipInfoDto(name, type, flagship, afterlv, maxBull, maxFuel);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement