SFloorParser.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.SFloorParser = void 0;
  4. const SParser_1 = require("./SParser");
  5. class SFloorParser extends SParser_1.SParser {
  6. constructor() {
  7. super(...arguments);
  8. this.wallList = [];
  9. this.columnList = [];
  10. this.doorList = [];
  11. this.casementList = [];
  12. this.virtualWallList = [];
  13. this.spaceList = [];
  14. }
  15. parseData(data) {
  16. if (data.Walls) {
  17. data.Walls.forEach((t) => {
  18. this.addWall(t);
  19. });
  20. }
  21. if (data.Columns) {
  22. data.Columns.forEach((t) => {
  23. this.addColumn(t);
  24. });
  25. }
  26. if (data.Windows) {
  27. data.Windows.forEach((t) => {
  28. this.addCasement(t);
  29. });
  30. }
  31. if (data.VirtualWalls) {
  32. data.VirtualWalls.forEach((t) => {
  33. this.addVirtualWall(t);
  34. });
  35. }
  36. if (data.Doors) {
  37. data.Doors.forEach((t) => {
  38. this.addDoor(t);
  39. });
  40. }
  41. if (data.Spaces) {
  42. data.Spaces.forEach((t) => {
  43. this.addSpace(t);
  44. });
  45. }
  46. }
  47. addWall(t) {
  48. let item = this.factory.createWall(t);
  49. this.wallList.push(item);
  50. }
  51. addColumn(t) {
  52. let item = this.factory.createColumn(t);
  53. this.columnList.push(item);
  54. }
  55. addCasement(t) {
  56. let item = this.factory.createWindow(t);
  57. this.casementList.push(item);
  58. }
  59. addVirtualWall(t) {
  60. let item = this.factory.createVirtualWall(t);
  61. this.virtualWallList.push(item);
  62. }
  63. addDoor(t) {
  64. let item = this.factory.createDoor(t);
  65. this.doorList.push(item);
  66. }
  67. addSpace(t) {
  68. let item = this.factory.createSpace(t);
  69. this.spaceList.push(item);
  70. }
  71. }
  72. exports.SFloorParser = SFloorParser;