~starkingdoms/starkingdoms

ref: d2ee73e74ad65a4a21a1450e880fbfd7eade1005 starkingdoms/starkingdoms-client/src/textures.ts -rw-r--r-- 1.2 KiB
d2ee73e7 — ghostlyzsh no more attaching cargo to cargo 1 year, 11 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { PartType, PlanetType } from "./protocol.ts";
import tex_earth from "./assets/earth.svg";
import tex_moon from "./assets/moon.svg";
import tex_mars from "./assets/mars.svg";
import tex_hearty from "./assets/hearty.svg";
import tex_cargo_off from "./assets/cargo_off.svg";
import tex_hub_off from "./assets/hub_off.svg";
import tex_landing_thruster from "./assets/landingthruster_off.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.Earth) {
    return tex_earth;
  } else if (type == PlanetType.Moon) {
    return tex_moon;
  } else if (type == PlanetType.Mars) {
    return tex_mars;
  }
  return tex_missing;
}

export function part_texture_url(type: PartType): string {
  if (type == PartType.Hearty) {
    return tex_hearty;
  } else if (type == PartType.Cargo) {
    return tex_cargo_off;
  } else if (type == PartType.Hub) {
    return tex_hub_off;
  } else if (type == PartType.LandingThruster) {
    return tex_landing_thruster;
  } else if (type == PartType.LandingThrusterSuspension) {
    return tex_landing_thruster_suspension;
  }
  return tex_missing;
}