From eb208a7e2fd020ab5d07d11cc6d52d1e3dcfcc7c Mon Sep 17 00:00:00 2001 From: Georgios Andreadis Date: Sun, 17 Sep 2017 17:55:04 +0200 Subject: Add simulation mode framework Includes object states in the store (by tick), charting, and progress bars. --- src/components/map/groups/TileGroup.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'src/components/map/groups/TileGroup.js') diff --git a/src/components/map/groups/TileGroup.js b/src/components/map/groups/TileGroup.js index 8fbdeb31..3de712d1 100644 --- a/src/components/map/groups/TileGroup.js +++ b/src/components/map/groups/TileGroup.js @@ -1,25 +1,34 @@ import PropTypes from "prop-types"; import React from "react"; import {Group} from "react-konva"; +import {ROOM_DEFAULT_COLOR, ROOM_IN_CONSTRUCTION_COLOR} from "../../../colors/index"; +import RackContainer from "../../../containers/map/RackContainer"; import Shapes from "../../../shapes/index"; +import {convertLoadToSimulationColor} from "../../../util/simulation-load"; import RoomTile from "../elements/RoomTile"; -import RackGroup from "./RackGroup"; -const TileGroup = ({tile, newTile, onClick}) => { +const TileGroup = ({tile, newTile, inSimulation, roomLoad, onClick}) => { let tileObject; switch (tile.objectType) { case "RACK": - tileObject = ; + tileObject = ; break; default: tileObject = null; } + let color = ROOM_DEFAULT_COLOR; + if (newTile) { + color = ROOM_IN_CONSTRUCTION_COLOR; + } else if (inSimulation) { + color = convertLoadToSimulationColor(roomLoad); + } + return ( onClick(tile)} > - + {tileObject} ); -- cgit v1.2.3