summaryrefslogtreecommitdiff
path: root/src/scripts/views/layers/wall.ts
diff options
context:
space:
mode:
authorGeorgios Andreadis <g.andreadis@student.tudelft.nl>2017-09-23 09:48:38 +0200
committerGeorgios Andreadis <g.andreadis@student.tudelft.nl>2017-09-23 09:48:38 +0200
commit09596c3c5a6a2a44675f170106bb38746229e02a (patch)
tree763d1b710dc5f2fcab920ac6ab2c555cee4d6342 /src/scripts/views/layers/wall.ts
parent057952b0bacc6e963c74bb1bbebbcccd6174a75c (diff)
Remove old frontend
Diffstat (limited to 'src/scripts/views/layers/wall.ts')
-rw-r--r--src/scripts/views/layers/wall.ts62
1 files changed, 0 insertions, 62 deletions
diff --git a/src/scripts/views/layers/wall.ts b/src/scripts/views/layers/wall.ts
deleted file mode 100644
index 06ba4675..00000000
--- a/src/scripts/views/layers/wall.ts
+++ /dev/null
@@ -1,62 +0,0 @@
-import {Colors} from "../../colors";
-import {MapView} from "../mapview";
-import {Util} from "../../util";
-import {Layer} from "./layer";
-import {CELL_SIZE} from "../../controllers/mapcontroller";
-
-
-/**
- * Class responsible for rendering the walls.
- */
-export class WallLayer implements Layer {
- public container: createjs.Container;
-
- private mapView: MapView;
- private walls: IRoomWall[];
- private wallLineWidth: number;
-
-
- constructor(mapView: MapView) {
- this.mapView = mapView;
- this.container = new createjs.Container();
- this.wallLineWidth = CELL_SIZE / 20.0;
-
- this.generateWalls();
- this.draw();
- }
-
- /**
- * Calls the Util.deriveWallLocations function to generate the wall locations.
- */
- public generateWalls(): void {
- this.walls = Util.deriveWallLocations(this.mapView.currentDatacenter.rooms);
- }
-
- /**
- * Draws all walls to the canvas.
- */
- public draw(): void {
- this.container.removeAllChildren();
-
- // Draw walls
- this.walls.forEach((element: IRoomWall) => {
- if (element.horizontal) {
- MapView.drawLine(
- CELL_SIZE * element.startPos[0] - this.wallLineWidth / 2.0,
- CELL_SIZE * element.startPos[1],
- CELL_SIZE * (element.startPos[0] + element.length) + this.wallLineWidth / 2.0,
- CELL_SIZE * element.startPos[1],
- this.wallLineWidth, Colors.WALL_COLOR, this.container
- );
- } else {
- MapView.drawLine(
- CELL_SIZE * element.startPos[0],
- CELL_SIZE * element.startPos[1] - this.wallLineWidth / 2.0,
- CELL_SIZE * element.startPos[0],
- CELL_SIZE * (element.startPos[1] + element.length) + this.wallLineWidth / 2.0,
- this.wallLineWidth, Colors.WALL_COLOR, this.container
- );
- }
- });
- }
-} \ No newline at end of file