import {Player as PlayerDot} from './Render/Player'; import {Building as BuildingDot} from './Render/Building'; import {Projectile as ProjectileDot} from './Render/Projectile'; import {findMapAlias} from './MapBoundries'; import {PlayerState, Header, WorldBoundaries, BuildingState, ProjectileState} from "./Data/Parser"; import {Show} from "solid-js"; export interface MapRenderProps { header: Header; players: PlayerState[]; buildings: BuildingState[]; projectiles: ProjectileState[]; size: { width: number; height: number; }, world: WorldBoundaries; scale: number; onHover: (userId: number) => void; highlighted: number; } const map_root = document.querySelector('[data-maps]').getAttribute('data-maps'); export function MapRender(props: MapRenderProps) { const mapAlias = findMapAlias(props.header.map); const image = `${map_root}images/${mapAlias}.webp`; const background = `url(${image})`; return ( {(player) => } {(building) => } {(projectile) => } ); }