~starkingdoms/starkingdoms

ref: c95c0de7db4cf819f1a34f0826a3a581fcace059 starkingdoms/starkingdoms-client/src/textures.ts -rw-r--r-- 704 bytes
c95c0de7 — ghostlyzsh broken code 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
import { PartType, PlanetType } from "./protocol.ts";
import tex_earth from "./assets/earth.svg";
import tex_moon from "./assets/moon.svg";
import tex_hearty from "./assets/hearty.svg";
import tex_cargo_off from "./assets/cargo_off.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;
  }
  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;
  }
  return tex_missing;
}