summaryrefslogtreecommitdiff
path: root/src/components/map/groups/RoomGroup.js
blob: 5f349e3c9ac26e228046178cd3c52d628c3c0bde (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import React from "react";
import {Group} from "react-konva";
import Shapes from "../../../shapes/index";
import {deriveWallLocations} from "../../../util/tile-calculations";
import WallSegment from "../elements/WallSegment";
import TileGroup from "./TileGroup";

const RoomGroup = ({room}) => (
    <Group>
        {room.tiles.map(tile => (
            <TileGroup key={tile.id} tile={tile}/>
        ))}
        {deriveWallLocations(room).map((wallSegment, index) => (
            <WallSegment key={index} wallSegment={wallSegment}/>
        ))}
    </Group>
);

RoomGroup.propTypes = {
    room: Shapes.Room,
};

export default RoomGroup;