package data.scripts.world;

import java.awt.Color;
import java.util.List;

import com.fs.starfarer.api.campaign.CampaignFleetAPI;
import com.fs.starfarer.api.campaign.CargoAPI;
import com.fs.starfarer.api.campaign.FactionAPI;
import com.fs.starfarer.api.campaign.FleetAssignment;
import com.fs.starfarer.api.campaign.SectorAPI;
import com.fs.starfarer.api.campaign.SectorEntityToken;
import com.fs.starfarer.api.campaign.SectorGeneratorPlugin;
import com.fs.starfarer.api.campaign.StarSystemAPI;
import com.fs.starfarer.api.campaign.CargoAPI.CrewXPLevel;
import com.fs.starfarer.api.fleet.FleetMemberType;

@SuppressWarnings("unchecked")
public class InterstellarFederationSectorGen implements SectorGeneratorPlugin {

	public void generate(SectorAPI sector) {
		
		StarSystemAPI system = sector.getStarSystem("Corvus");
		SectorEntityToken sol = system.createToken(0, 0);
		
		SectorEntityToken station3 = system.addOrbitalStation(sol, 275, 14000, 400, "Perimeter Outpost", "interstellarFederation");

		float angle = (float) ((float) Math.random() * Math.PI * 2f);
		float x = (float) (Math.cos(angle) * 17000f);
		float y = (float) (Math.sin(angle) * 17000f);
		SectorEntityToken IFconvoy = system.createToken(x, y);
		system.addSpawnPoint(new InterstellarFederationConvoySpawnPoint(sector, system, 10, 1, IFconvoy, station3));
		
		InterstellarFederationSpawnPoint IFSpawn = new InterstellarFederationSpawnPoint(sector, system, 5, 5, station3);
		system.addSpawnPoint(IFSpawn);
		
		for (int i = 0; i < 6; ++i ) IFSpawn.spawnFleet();	

                FactionAPI interstellarFederation = sector.getFaction("interstellarFederation");

		interstellarFederation.setRelationship("hegemony", -1);
		interstellarFederation.setRelationship("tritachyon", -1);
		interstellarFederation.setRelationship("pirates", -1);
		interstellarFederation.setRelationship("independent", -1);       
    
	}
	
}
