001package com.fs.starfarer.api.campaign; 002 003import java.awt.Color; 004import java.util.List; 005 006import org.lwjgl.util.vector.Vector2f; 007 008import com.fs.starfarer.api.impl.campaign.procgen.Constellation; 009import com.fs.starfarer.api.impl.campaign.procgen.StarAge; 010import com.fs.starfarer.api.impl.campaign.procgen.StarSystemGenerator.StarSystemType; 011 012/** 013 * @author Alex Mosolov 014 * 015 * Copyright 2012 Fractal Softworks, LLC 016 */ 017public interface StarSystemAPI extends LocationAPI { 018 019 020 Vector2f getLocation(); 021 022 /** 023 * Will not automatically generate a hyperspace anchor for the star. 024 * Call autogenerateHyperspaceJumpPoints() to do that, or create the 025 * anchor manually using JumpPointAPI. 026 * @param id unique id for this star 027 * @param type 028 * @param color 029 * @param radius 030 * @return 031 */ 032 PlanetAPI initStar(String id, String type, float radius, float coronaSize, float windBurnLevel, float flareProbability, float crLossMult); 033 034 PlanetAPI initStar(String id, String type, float radius, float coronaSize); 035 036 /** 037 * Generates the hyperspace anchor for the star (and nothing else - no gas giant gravity 038 * wells or fringe jump point), unless one was already generated. 039 */ 040 void generateAnchorIfNeeded(); 041 042 /** 043 * Color argument is not used. Use PlanetAPI.getSpec() instead. 044 * 045 */ 046 @Deprecated PlanetAPI initStar(String id, String type, Color color, float radius, float coronaSize); 047 048 049 /** 050 * Also automatically creates a wormhole/jump point leading to the star from hyperspace. This 051 * wormhole can be accessed using getHyperspaceAnchor(). 052 * @param id unique id for this star 053 * @param type 054 * @param color 055 * @param radius 056 * @param hyperspaceLocationX 057 * @param hyperspaceLocationY 058 * @return 059 */ 060 PlanetAPI initStar(String id, String type, float radius, float hyperspaceLocationX, float hyperspaceLocationY, float coronaSize); 061 062 063 /** 064 * A location token corresponding to the center of the system in hyperspace. 065 */ 066 SectorEntityToken getHyperspaceAnchor(); 067 068 void setHyperspaceAnchor(SectorEntityToken hyperspaceAnchor); 069 070 071 PlanetAPI getStar(); 072 073 074 /** 075 * Calls autogenerateHyperspaceJumpPoints(false, false) 076 */ 077 void autogenerateHyperspaceJumpPoints(); 078 079 080 /** 081 * Generates jump points into the system and adds them to hyperspace. 082 * 083 * Jump points generated are based on the jump points within the system. 084 * 085 * Also adds jump destinations from all in-system jump points to the associated, 086 * newly-generated hyperspace jump points. 087 * 088 * Will also generate a wormhole for the star if one doesn't exist already. 089 * 090 * @param generateEntrancesAtGasGiants whether one-way jump points into the system are generated at gas giants 091 * @param generateFringeJumpPoint whether an extra jump point (two-way) is generated on the fringes of the system 092 */ 093 void autogenerateHyperspaceJumpPoints(boolean generateEntrancesAtGasGiants, boolean generateFringeJumpPoint); 094 095 096 Color getLightColor(); 097 /** 098 * Only applicable if this location has a light source (i.e. a star). 099 * @param lightColor 100 */ 101 void setLightColor(Color lightColor); 102 103 /** 104 * Star name without "Star System" appended to it. 105 * @return 106 */ 107 String getBaseName(); 108 109 /** 110 * Only considers jump points into the system generated by autogenerateHyperspaceJumpPoints. 111 * 112 * @return 113 */ 114 float getMaxRadiusInHyperspace(); 115 116 SectorEntityToken initNonStarCenter(); 117 118 SectorEntityToken getCenter(); 119 120 void setStar(PlanetAPI star); 121 void setBaseName(String baseName); 122 123 PlanetAPI getSecondary(); 124 void setSecondary(PlanetAPI secondary); 125 PlanetAPI getTertiary(); 126 void setTertiary(PlanetAPI tertiary); 127 128 List<JumpPointAPI> getAutogeneratedJumpPointsInHyper(); 129 130 StarSystemType getType(); 131 void setType(StarSystemType type); 132 133 /** 134 * Can be null for non-procgen systems. Can be a one-system constellation for lone star systems. 135 * @return 136 */ 137 Constellation getConstellation(); 138 139 /** 140 * Returns false if the constellation is null or contains only one star system. 141 * @return 142 */ 143 boolean isInConstellation(); 144 145 void setConstellation(Constellation constellation); 146 147 void setCenter(SectorEntityToken center); 148 149 void autogenerateHyperspaceJumpPoints(boolean generateEntrancesAtGasGiants, boolean generateFringeJumpPoint, boolean generatePlanetConditions); 150 151 void setProcgen(boolean isProcgen); 152 boolean isProcgen(); 153 154 StarAge getAge(); 155 void setAge(StarAge age); 156 Boolean hasSystemwideNebula(); 157 void setHasSystemwideNebula(Boolean hasSystemwideNebula); 158 159 boolean isEnteredByPlayer(); 160 void setEnteredByPlayer(boolean enteredByPlayer); 161 162 long getLastPlayerVisitTimestamp(); 163 164 float getDaysSinceLastPlayerVisit(); 165 166 boolean hasPulsar(); 167 168 Boolean getDoNotShowIntelFromThisLocationOnMap(); 169 void setDoNotShowIntelFromThisLocationOnMap(Boolean doNotShowIntelFromThisLocationOnMap); 170 171 boolean hasBlackHole(); 172 173 Float getMapGridWidthOverride(); 174 void setMapGridWidthOverride(Float mapGridWidthOverride); 175 Float getMapGridHeightOverride(); 176 void setMapGridHeightOverride(Float mapGridHeightOverride); 177 178 void setMaxRadiusInHyperspace(float maxRadiusInHyperspace); 179 180 181 /** 182 * If non-null, will be used by the SectorAPI.getStarSystem(String) method. 183 * @param optionalUniqueId 184 */ 185 String getOptionalUniqueId(); 186 /** 187 * If non-null, will be used by the SectorAPI.getStarSystem(String) method. 188 * @param optionalUniqueId 189 */ 190 void setOptionalUniqueId(String optionalUniqueId); 191 192 List<NascentGravityWellAPI> getAutogeneratedNascentWellsInHyper(); 193}