// Path: app/src/main/java/com/antest1/kcanotify/KcaApiData.java
// public static final int STYPE_AR = 19;
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaApiData.java
// public static final int STYPE_AS = 20;
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaApiData.java
// public static final int STYPE_BB = 9;
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaApiData.java
// public static final int STYPE_BBV = 10;
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaApiData.java
// public static final int STYPE_CA = 5;
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaApiData.java
// public static final int STYPE_CAV = 6;
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaApiData.java
// public static final int STYPE_CV = 11;
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaApiData.java
// public static final int STYPE_CVB = 18;
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaApiData.java
// public static final int STYPE_CVL = 7;
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaApiData.java
// public static final int STYPE_DE = 1;
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaApiData.java
// public static final int STYPE_FBB = 8;
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaApiData.java
// public static final int STYPE_SS = 13;


import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import static com.antest1.kcanotify.KcaApiData.STYPE_AR;
import static com.antest1.kcanotify.KcaApiData.STYPE_AS;
import static com.antest1.kcanotify.KcaApiData.STYPE_BB;
import static com.antest1.kcanotify.KcaApiData.STYPE_BBV;
import static com.antest1.kcanotify.KcaApiData.STYPE_CA;
import static com.antest1.kcanotify.KcaApiData.STYPE_CAV;
import static com.antest1.kcanotify.KcaApiData.STYPE_CV;
import static com.antest1.kcanotify.KcaApiData.STYPE_CVB;
import static com.antest1.kcanotify.KcaApiData.STYPE_CVL;
import static com.antest1.kcanotify.KcaApiData.STYPE_DE;
import static com.antest1.kcanotify.KcaApiData.STYPE_FBB;
import static com.antest1.kcanotify.KcaApiData.STYPE_SS;
    public static JsonArray getDockData() { return dockdata; }
    public static void setDockData(JsonArray v) { dockdata = v; }
    public static long getCompleteTime(int dock) { return complete_time_check[dock]; }
    public static void setCompleteTime(int dock, long time) {
        complete_time_check[dock] = time;
    }
    public static int getShipId(int dock) { return dock_ship_id[dock]; }
    public static void setShipId(int dock, int id) { dock_ship_id[dock] = id; }
    public static boolean checkShipInDock(int id) {
        if (id <= 0) return false;
        for (int sid : dock_ship_id) {
            if (sid == id) return true;
        }
        return false;
    }
    public static int getDockingTime(int hp_loss, int level, int stype) {
        if (hp_loss > 0) {
            int repair_time = 0;
            double multiplier = getMultiplier(stype);
            if (level <= 11) {
                repair_time = 30 + (int) (hp_loss * (level * 10) * multiplier);
            } else {
                repair_time = 30 + (int) (hp_loss * ((level * 5) + Math.floor(Math.sqrt(level - 11)) * 10 + 50) * multiplier);
            }
            return repair_time;
        } else {
            return 0;
        }
    }
    private static double getMultiplier(int type) {
// Path: app/src/main/java/com/antest1/kcanotify/KcaApiData.java
// public static final int STYPE_AR = 19;
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaApiData.java
// public static final int STYPE_AS = 20;
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaApiData.java
// public static final int STYPE_BB = 9;
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaApiData.java
// public static final int STYPE_BBV = 10;
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaApiData.java
// public static final int STYPE_CA = 5;
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaApiData.java
// public static final int STYPE_CAV = 6;
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaApiData.java
// public static final int STYPE_CV = 11;
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaApiData.java
// public static final int STYPE_CVB = 18;
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaApiData.java
// public static final int STYPE_CVL = 7;
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaApiData.java
// public static final int STYPE_DE = 1;
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaApiData.java
// public static final int STYPE_FBB = 8;
// 
// Path: app/src/main/java/com/antest1/kcanotify/KcaApiData.java
// public static final int STYPE_SS = 13;


// Path: app/src/main/java/com/antest1/kcanotify/KcaDocking.java
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import static com.antest1.kcanotify.KcaApiData.STYPE_AR;
import static com.antest1.kcanotify.KcaApiData.STYPE_AS;
import static com.antest1.kcanotify.KcaApiData.STYPE_BB;
import static com.antest1.kcanotify.KcaApiData.STYPE_BBV;
import static com.antest1.kcanotify.KcaApiData.STYPE_CA;
import static com.antest1.kcanotify.KcaApiData.STYPE_CAV;
import static com.antest1.kcanotify.KcaApiData.STYPE_CV;
import static com.antest1.kcanotify.KcaApiData.STYPE_CVB;
import static com.antest1.kcanotify.KcaApiData.STYPE_CVL;
import static com.antest1.kcanotify.KcaApiData.STYPE_DE;
import static com.antest1.kcanotify.KcaApiData.STYPE_FBB;
import static com.antest1.kcanotify.KcaApiData.STYPE_SS;

    public static JsonArray getDockData() { return dockdata; }
    public static void setDockData(JsonArray v) { dockdata = v; }
    public static long getCompleteTime(int dock) { return complete_time_check[dock]; }
    public static void setCompleteTime(int dock, long time) {
        complete_time_check[dock] = time;
    }
    public static int getShipId(int dock) { return dock_ship_id[dock]; }
    public static void setShipId(int dock, int id) { dock_ship_id[dock] = id; }
    public static boolean checkShipInDock(int id) {
        if (id <= 0) return false;
        for (int sid : dock_ship_id) {
            if (sid == id) return true;
        }
        return false;
    }
    public static int getDockingTime(int hp_loss, int level, int stype) {
        if (hp_loss > 0) {
            int repair_time = 0;
            double multiplier = getMultiplier(stype);
            if (level <= 11) {
                repair_time = 30 + (int) (hp_loss * (level * 10) * multiplier);
            } else {
                repair_time = 30 + (int) (hp_loss * ((level * 5) + Math.floor(Math.sqrt(level - 11)) * 10 + 50) * multiplier);
            }
            return repair_time;
        } else {
            return 0;
        }
    }
    private static double getMultiplier(int type) {
        if (type == STYPE_BB || type == STYPE_BBV || type == STYPE_CV || type == STYPE_CVB || type == STYPE_AR) return 2.0;