wrapped all team data in a single object and socket message

This commit is contained in:
Quentin Roussel
2024-03-29 02:03:43 +01:00
parent 11a62dfb54
commit 00e8959173
5 changed files with 49 additions and 15 deletions

View File

@@ -26,6 +26,9 @@ function MapPan(props) {
export default function LiveMap({ ...props}) {
const {currentPosition, enemyPosition} = useGame();
useEffect(() => {
console.log('Current position', currentPosition);
}, [currentPosition]);
return (
<MapContainer {...props} className='min-h-full z-0' center={[0,0]} zoom={0} scrollWheelZoom={true}>
<TileLayer
@@ -58,3 +61,16 @@ export default function LiveMap({ ...props}) {
</MapContainer>
)
}
export function PlacementMap({ ...props}) {
const {currentPosition, startingArea} = useGame();
return (
<MapContainer {...props} className='min-h-full w-full' scrollWheelZoom={true}>
<TileLayer
attribution='&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
/>
<MapPan center={currentPosition}/>
</MapContainer>
)
}