001package com.fs.starfarer.api.combat; 002 003import java.util.List; 004import java.util.Map; 005 006import org.lwjgl.util.vector.Vector2f; 007 008import com.fs.starfarer.api.characters.PersonAPI; 009import com.fs.starfarer.api.fleet.FleetGoal; 010import com.fs.starfarer.api.fleet.FleetMemberAPI; 011 012/** 013 * @author Alex Mosolov 014 * 015 * Copyright 2012 Fractal Softworks, LLC 016 */ 017public interface CombatFleetManagerAPI { 018 public interface AssignmentInfo { 019 CombatAssignmentType getType(); 020 AssignmentTargetAPI getTarget(); 021 List<DeployedFleetMemberAPI> getAssignedMembers(); 022 } 023 024 025// public MutableStat getCommandPointsStat(); 026// public MutableStat getMaxFleetPoints(); 027 028 /** 029 * Deploy a ship/fighter wing with the given spec or variant id. 030 * 031 * If there isn't one in the reserves, a temporary FleetMemberAPI is created and added to the reserves 032 * (but not the underlying CampaignFleetAPI, if any) 033 * 034 * @param id 035 * @param location Where to deploy. 036 * @param facing Facing at time of deployment. 037 * @return 038 */ 039 public ShipAPI spawnShipOrWing(String specId, Vector2f location, float facing); 040 041 /** 042 * Deploy a ship/fighter wing with the given spec or variant id. 043 * 044 * If there isn't one in the reserves, a temporary FleetMemberAPI is created and added to the reserves 045 * (but not the underlying CampaignFleetAPI, if any) 046 * @param specId 047 * @param location 048 * @param facing 049 * @param level crew experience level 050 * @param initialBurnDur amount of time travel drive should be on (in seconds) 051 * @return 052 */ 053 public ShipAPI spawnShipOrWing(String specId, Vector2f location, float facing, float initialBurnDur); 054 055 /** 056 * member does not actually have to be in the reserves. 057 * @param member 058 * @param location 059 * @param facing 060 * @param initialBurnDur 061 * @return 062 */ 063 public ShipAPI spawnFleetMember(FleetMemberAPI member, Vector2f location, float facing, float initialBurnDur); 064 065 066 067 /** 068 * Returns ship that corresponds to the fleet member passed in. Returns the wing leader for fighter wings. 069 * @param fleetMember 070 * @return 071 */ 072 public ShipAPI getShipFor(FleetMemberAPI fleetMember); 073 074 public List<FleetMemberAPI> getDeployedCopy(); 075 public List<FleetMemberAPI> getReservesCopy(); 076 077 078 DeployedFleetMemberAPI getDeployedFleetMember(ShipAPI ship); 079 DeployedFleetMemberAPI getDeployedFleetMemberEvenIfDisabled(ShipAPI ship); 080 AssignmentTargetAPI createWaypoint(Vector2f location, boolean ally); 081 082 083 FleetGoal getGoal(); 084 void addToReserves(FleetMemberAPI member); 085 void removeFromReserves(FleetMemberAPI member); 086 087 CombatTaskManagerAPI getTaskManager(boolean ally); 088 089 boolean isOnlyTimidOrNonCombatDeployed(); 090 091 List<FleetMemberAPI> getDisabledCopy(); 092 List<FleetMemberAPI> getDestroyedCopy(); 093 List<FleetMemberAPI> getRetreatedCopy(); 094 095 boolean isSuppressDeploymentMessages(); 096 void setSuppressDeploymentMessages(boolean suppressDeploymentMessages); 097 098 099 boolean isDefendingStation(); 100 List<DeployedFleetMemberAPI> getStations(); 101 102 List<DeployedFleetMemberAPI> getDeployedCopyDFM(); 103 104 int getOwner(); 105 106 void setDefaultCommander(PersonAPI defaultCommander); 107 PersonAPI getDefaultCommander(); 108 109 /** 110 * May return null if both the reserves and the deployed lists are empty. 111 * @return 112 */ 113 PersonAPI getFleetCommander(); 114 115 /** 116 * Max deployment points available. 117 * @return 118 */ 119 int getMaxStrength(); 120 121 boolean isDeployedStation(); 122 void setDeployedStation(boolean deployedStation); 123 124 void setDeploymentYOffset(float deploymentYOffset); 125 float getDeploymentYOffset(); 126 127 float getEnemyCleanDisengageProgress(); 128 float getEnemyCleanDisengageThreshold(); 129 float getEnemyCleanDisengagePoints(); 130 boolean canEnemyDisengageCleanly(); 131 132 List<PersonAPI> getAllFleetCommanders(); 133 PersonAPI getFleetCommanderPreferPlayer(); 134 135 List<DeployedFleetMemberAPI> getAllEverDeployedCopy(); 136 137 boolean isCanForceShipsToEngageWhenBattleClearlyLost(); 138 139 /** 140 * Defaults to true for enemy, false for player side. 141 * @param canForceShipsToEngageWhenBattleClearlyLost 142 */ 143 void setCanForceShipsToEngageWhenBattleClearlyLost(boolean canForceShipsToEngageWhenBattleClearlyLost); 144 145 ShipAPI spawnShipOrWing(String specId, Vector2f location, float facing, float initialBurnDur, PersonAPI captain); 146 147 Map<DeployedFleetMemberAPI, DeployedFleetMemberAPI> getShardToOriginalShipMap(); 148 149 DeployedFleetMemberAPI getDeployedFleetMemberFromAllEverDeployed(ShipAPI ship); 150 151 ShipAPI getShipFor(PersonAPI captain); 152 153 FleetMemberAPI getBiggestStationDeployedOrNot(); 154 155 AdmiralAIPlugin getAdmiralAI(); 156 void setAdmiralAI(AdmiralAIPlugin admiralAI); 157 158 void removeDeployed(ShipAPI ship, boolean retreated); 159 160 void setMaxStrength(int maxStrength); 161 int getCurrStrength(); 162 void modifyFlatMax(String source, int value); 163 void modifyPercentMax(String source, float percent); 164 void unmodifyMax(); 165 166 void removeDeployed(FighterWingAPI wing, boolean retreated); 167} 168 169 170 171 172