001package com.fs.starfarer.api.fleet;
002
003import org.lwjgl.util.vector.Vector2f;
004
005import com.fs.starfarer.api.campaign.BuffManagerAPI;
006import com.fs.starfarer.api.campaign.FleetDataAPI;
007import com.fs.starfarer.api.characters.PersonAPI;
008import com.fs.starfarer.api.combat.MutableShipStatsAPI;
009import com.fs.starfarer.api.combat.ShipHullSpecAPI;
010import com.fs.starfarer.api.combat.ShipVariantAPI;
011import com.fs.starfarer.api.loading.WithSourceMod;
012
013/**
014 * @author Alex Mosolov
015 *
016 * Copyright 2012 Fractal Softworks, LLC
017 */
018public interface FleetMemberAPI extends WithSourceMod {
019        PersonAPI getCaptain();
020        
021        
022        MutableShipStatsAPI getStats();
023        
024        String getShipName();
025        void setShipName(String name);
026        
027        /**
028         * Unique id, generated using Misc.genUID().
029         * @return
030         */
031        String getId();
032        
033        String getSpecId();
034        String getHullId();
035        FleetMemberType getType();
036        
037        boolean isFlagship();
038        
039        int getNumFlightDecks();
040        boolean isCarrier();
041        boolean isCivilian();
042        //boolean isWoefullyUndergunned();
043        void setFlagship(boolean isFlagship);
044        int getFleetPointCost();
045        boolean isFighterWing();
046        boolean isFrigate();
047        boolean isDestroyer();
048        boolean isCruiser();
049        boolean isCapital();
050        int getNumFightersInWing();
051        float getFuelCapacity();
052        float getCargoCapacity();
053        float getMinCrew();
054        float getNeededCrew();
055        float getMaxCrew();
056        float getFuelUse();
057        
058        RepairTrackerAPI getRepairTracker();
059        ShipHullSpecAPI getHullSpec();
060        PersonAPI getFleetCommander();
061        
062        
063        boolean canBeDeployedForCombat();
064        ShipVariantAPI getVariant();
065        FleetDataAPI getFleetData();
066        
067        void setVariant(ShipVariantAPI variant, boolean withRefit, boolean withStatsUpdate);
068        CrewCompositionAPI getCrewComposition();
069        FleetMemberStatusAPI getStatus();
070        
071        
072        /**
073         * Fraction of crew on the ship, 0 to 1, ignores levels of crew.
074         * @return
075         */
076        float getCrewFraction();
077        
078        
079        int getReplacementChassisCount();
080        
081        
082        /**
083         * Probably not needed given the current state of the API.
084         * @param statUpdateNeeded
085         */
086        void setStatUpdateNeeded(boolean statUpdateNeeded);
087        
088        BuffManagerAPI getBuffManager();
089        
090        boolean isMothballed();
091        
092        /**
093         * From 0 to 1, CR fraction. Multiplied by number of fighters if fighter wing.
094         * @return
095         */
096        float getDeployCost();
097        void setCaptain(PersonAPI commander);
098        
099        /**
100         * Based on fleet points, modified by CR and ordnance points actually used by the variant.
101         * 
102         * Not modified by hull status or captain quality.
103         * @return
104         */
105        float getMemberStrength();
106        
107        
108        int getOwner();
109        void setOwner(int owner);
110        
111        
112        /**
113         * In credits. Includes properly-adjusted cost of mounted weapons. Does not include any tariffs.
114         * @return
115         */
116        float getBaseSellValue();
117        
118        /**
119         * In credits. Includes properly-adjusted cost of mounted weapons. Does not include any tariffs.
120         * @return
121         */
122        float getBaseBuyValue();
123        
124        boolean needsRepairs();
125        boolean canBeRepaired();
126        
127        float getDeploymentPointsCost();
128        float getDeploymentCostSupplies();
129        float getBaseDeployCost();
130        
131        
132        /**
133         * True for non-player-controlled ships on the player's side in combat.
134         * Transient, not saved.
135         * @return
136         */
137        boolean isAlly();
138        
139        /**
140         * True for non-player-controlled ships on the player's side in combat.
141         * Transient, not saved.
142         */
143        void setAlly(boolean isAlly);
144        void setFleetCommanderForStats(PersonAPI alternateFleetCommander, FleetDataAPI fleetForStats);
145        FleetDataAPI getFleetDataForStats();
146        PersonAPI getFleetCommanderForStats();
147        void updateStats();
148
149
150        boolean isStation();
151
152
153//      ShipVariantAPI getModuleVariant(String slotId);
154//      void setModuleVariant(String slotId, ShipVariantAPI variant);
155
156
157        float getBaseDeploymentCostSupplies();
158        //float getMaintenanceCostSupplies();
159
160
161        /**
162         * Base value of hull and all mounted non-built-in weapons and fighter LPCs.
163         * @return
164         */
165        float getBaseValue();
166
167
168        /**
169         * Sprite to use in the campaign view. Currently used by custom stations.
170         * @param spriteOverride
171         */
172        void setSpriteOverride(String spriteOverride);
173        String getSpriteOverride();
174
175        Vector2f getOverrideSpriteSize();
176        void setOverrideSpriteSize(Vector2f overrideSpriteSize);
177
178
179        boolean isPhaseShip();
180
181
182        void setId(String id);
183
184
185        float getUnmodifiedDeploymentPointsCost();
186
187
188        void setFlagship(boolean isFlagship, boolean withCaptainSet);
189
190
191        String getPersonalityOverride();
192        void setPersonalityOverride(String personalityOverride);
193
194
195}
196
197
198
199
200
201