001package com.fs.starfarer.api.campaign;
002
003import java.util.List;
004
005
006public interface JumpPointAPI extends SectorEntityToken {
007        
008        public static class JumpDestination {
009                private SectorEntityToken destination;
010                private String labelInInteractionDialog;
011                
012                private float minDistFromToken = 0;
013                private float maxDistFromToken = 0;
014                
015                public JumpDestination(SectorEntityToken destination, String labelInInteractionDialog) {
016                        this.destination = destination;
017                        this.labelInInteractionDialog = labelInInteractionDialog;
018                }
019                
020                public SectorEntityToken getDestination() {
021                        return destination;
022                }
023                public void setDestination(SectorEntityToken destination) {
024                        this.destination = destination;
025                }
026                public String getLabelInInteractionDialog() {
027                        return labelInInteractionDialog;
028                }
029                public void setLabelInInteractionDialog(String labelInInteractionDialog) {
030                        this.labelInInteractionDialog = labelInInteractionDialog;
031                }
032                public float getMinDistFromToken() {
033                        return minDistFromToken;
034                }
035                public void setMinDistFromToken(float minDistFromToken) {
036                        this.minDistFromToken = minDistFromToken;
037                }
038                public float getMaxDistFromToken() {
039                        return maxDistFromToken;
040                }
041                public void setMaxDistFromToken(float maxDistFromToken) {
042                        this.maxDistFromToken = maxDistFromToken;
043                }
044        }
045        
046        void setRadius(float radius);
047        
048        void addDestination(JumpDestination destination);
049        void clearDestinations();
050        void removeDestination(SectorEntityToken destination);
051        List<JumpDestination> getDestinations();
052        
053        
054        /**
055         * Also automatically sets the jump point size.
056         * @param category in settings.json
057         * @param id under category in settings.json
058         * @param entity can be null or a star/planet. Entity will be displayed at the end of the wormhole, above the background.
059         */
060        void setDestinationVisual(String category, String id, SectorEntityToken entity);
061        void setStandardWormholeToStarOrPlanetVisual(SectorEntityToken entity);
062        void setStandardWormholeToHyperspaceVisual();
063        void setStandardWormholeToStarfieldVisual();
064        void setStandardWormholeToNothingVisual();
065        
066        boolean isAutoCreateEntranceFromHyperspace();
067        
068        /**
069         * @return Whether the jump point leads to a star.
070         */
071        boolean isStarAnchor();
072        
073        /**
074         * @return Whether the jump point leads to a gas giant.
075         */
076        boolean isGasGiantAnchor();
077        
078        void setAutoCreateEntranceFromHyperspace(boolean autoCreateEntrance);
079
080        SectorEntityToken getDestinationVisualEntity();
081        
082        
083        SectorEntityToken getRelatedPlanet();
084        
085        /**
086         * This planet will be displayed by auto-generated jump points using this jump point as an exit.
087         * Should only be set for a jump point in the same location as the planet; only used for visuals.
088         * ONLY necessary if StatSystemAPI.autogenerateHyperspaceJumpPoints() is subsequently called.
089         * @param relatedPlanet
090         */
091        void setRelatedPlanet(SectorEntityToken relatedPlanet);
092        
093        
094        /**
095         * May only be called after this jump point was added to the system, and also after
096         * StarSystemAPI.autogenerateHyperspaceAnchors() was called for the system, OR initStar() was called
097         * with the "location in hyperspace" parameters (which auto-generates the main hyperspace anchor).
098         * @param entity
099         * @param radius
100         */
101        void autoUpdateHyperJumpPointLocationBasedOnInSystemEntityAtRadius(SectorEntityToken entity, float radius);
102        
103        
104        /**
105         * Purely visual.
106         */
107        void open();
108        
109        /**
110         * Purely visual.
111         */
112        void close();
113        
114        /**
115         * Skips animation.
116         */
117        void forceOpen();
118        
119        /**
120         * Skips animation.
121         */
122        void forceClose();
123
124        StarSystemAPI getDestinationStarSystem();
125
126        boolean isWormhole();
127
128
129}
130
131