001package com.fs.starfarer.api.combat; 002 003import java.util.ArrayList; 004import java.util.List; 005 006import com.fs.starfarer.api.combat.ShipAPI.HullSize; 007import com.fs.starfarer.api.fleet.FleetMemberAPI; 008 009public interface CombatReadinessPlugin { 010 011 public static enum CREffectDetailType { 012 PENALTY, 013 BONUS, 014 NEUTRAL, 015 } 016 017 public static class CREffectDetail { 018 private String desc; 019 private String value; 020 private CREffectDetailType type; 021 022 public CREffectDetail(String desc, String value, CREffectDetailType type) { 023 this.desc = desc; 024 this.value = value; 025 this.type = type; 026 } 027 public String getDesc() { 028 return desc; 029 } 030 public String getValue() { 031 return value; 032 } 033 public CREffectDetailType getType() { 034 return type; 035 } 036 } 037 038 public static class CREffectDescriptionForTooltip { 039 private String string; 040 private List<String> highlights = new ArrayList<String>(); 041 public String getString() { 042 return string; 043 } 044 public void setString(String string) { 045 this.string = string; 046 } 047 public List<String> getHighlights() { 048 return highlights; 049 } 050 } 051 052 053 public static class CRStatusItemData { 054 private String title; 055 private String text; 056 private String iconName; 057 private boolean isDebuff; 058 private Object idToken; 059 public CRStatusItemData(Object idToken, String iconName, 060 String title, String text, boolean isDebuff) { 061 this.title = title; 062 this.text = text; 063 this.iconName = iconName; 064 this.isDebuff = isDebuff; 065 this.idToken = idToken; 066 } 067 public String getTitle() { 068 return title; 069 } 070 public String getText() { 071 return text; 072 } 073 public String getIconName() { 074 return iconName; 075 } 076 public boolean isDebuff() { 077 return isDebuff; 078 } 079 public Object getIdToken() { 080 return idToken; 081 } 082 } 083 084 void applyMaxCRCrewModifiers(FleetMemberAPI member); 085 086 087 void applyCRToStats(float cr, MutableShipStatsAPI stats, HullSize hullSize); 088 void applyCRToShip(float cr, ShipAPI ship); 089 090 List<CRStatusItemData> getCRStatusDataForShip(ShipAPI ship); 091 092 float getMalfunctionThreshold(MutableShipStatsAPI stats); 093 float getCriticalMalfunctionThreshold(MutableShipStatsAPI stats); 094 095 096 /** 097 * Used to construct part of the CR tooltip in the fleet view. 098 * 099 * @param cr from 0 to 1 100 * @param shipOrWing "ship" or "fighter wing". 101 * @return 102 */ 103 CREffectDescriptionForTooltip getCREffectDescription(float cr, String shipOrWing, FleetMemberAPI member); 104 105 List<CREffectDetail> getCREffectDetails(float cr, FleetMemberAPI member); 106 float getMissileLoadedFraction(MutableShipStatsAPI stats, float cr); 107 108 109 boolean isOkToPermanentlyDisable(ShipAPI ship, Object module); 110} 111 112 113