import type { WorldPlayer } from "../types"; type Props = { width: number; height: number; players: WorldPlayer[]; portal: { x: number; y: number }; selfId: string; onTileClick: (x: number, y: number) => void; onPortalClick: () => void; }; export default function MapView({ width, height, players, portal, selfId, onTileClick, onPortalClick, }: Props) { const cells = []; for (let y = 0; y < height; y++) { for (let x = 0; x < width; x++) { const isPortal = x === portal.x && y === portal.y; const here = players.filter((p) => p.x === x && p.y === y); const terrain = (x + y) % 7 === 0 ? "mire" : (x * 3 + y) % 11 === 0 ? "bone" : "soil"; cells.push( ); } } return (
{cells}
); }