import { PartType, PlanetType } from "./protocol.ts"; import tex_sun from "./assets/sun.svg"; import tex_earth from "./assets/earth.svg"; import tex_moon from "./assets/moon.svg"; import tex_mars from "./assets/mars.svg"; import tex_earth_icon from "./assets/earth_icon.svg"; import tex_moon_icon from "./assets/moon_icon.svg"; import tex_mars_icon from "./assets/mars_icon.svg"; import tex_hearty from "./assets/hearty.svg"; import tex_cargo_off from "./assets/cargo_off.svg"; import tex_cargo_on from "./assets/cargo_on.svg"; import tex_hub_off from "./assets/hub_off.svg"; import tex_hub_on from "./assets/hub_on.svg"; import tex_landing_thruster_off from "./assets/landingthruster_off.svg"; import tex_landing_thruster_on from "./assets/landingthruster_on.svg"; import tex_landing_thruster_suspension from "./assets/landingleg.svg"; import tex_missing from "./assets/missing.svg"; export function planet_texture_url(type: PlanetType): string { if (type == PlanetType.Sun) { return tex_sun; } else if (type == PlanetType.Mercury) { return tex_mars; } else if (type == PlanetType.Venus) { return tex_moon; } else if (type == PlanetType.Earth) { return tex_earth; } else if (type == PlanetType.Moon) { return tex_moon; } else if (type == PlanetType.Mars) { return tex_mars; } else if (type == PlanetType.Jupiter) { return tex_earth; } else if (type == PlanetType.Saturn) { return tex_sun; } else if (type == PlanetType.Uranus) { return tex_mars; } else if (type == PlanetType.Neptune) { return tex_moon; } else if (type == PlanetType.Pluto) { return tex_mars; } return tex_missing; } export function indicator_texture_url(type: PlanetType): string { if (type == PlanetType.Earth) { return tex_earth_icon; } else if (type == PlanetType.Moon) { return tex_moon_icon; } else if (type == PlanetType.Mars) { return tex_mars_icon; } return tex_missing; } export function part_texture_url(type: PartType, attached: boolean): string { if (type == PartType.Hearty) { return tex_hearty; } else if (type == PartType.Cargo) { return attached ? tex_cargo_on : tex_cargo_off; } else if (type == PartType.Hub) { return attached ? tex_hub_on : tex_hub_off; } else if (type == PartType.LandingThruster) { return attached ? tex_landing_thruster_on : tex_landing_thruster_off; } else if (type == PartType.LandingThrusterSuspension) { return tex_landing_thruster_suspension; } return tex_missing; }