element_builder.js 832 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import { type_manager } from "./functions.js";
  2. import { element } from "./element.js";
  3. class element_builder {
  4. #name;
  5. #description;
  6. #pictures;
  7. #meshes;
  8. #solids;
  9. #order;
  10. constructor() {
  11. this.#order = [];
  12. this.#solids = [];
  13. this.#meshes = [];
  14. this.#pictures = [];
  15. this.#name = undefined;
  16. this.#description = undefined;
  17. }
  18. set name(target) {
  19. if (!type_manager.is_string(target)) {
  20. throw "Element name must be an string.";
  21. }
  22. this.#name = target;
  23. }
  24. set description(target) {
  25. if (!type_manager.is_string(target)) {
  26. throw "Description of the element must be an string.";
  27. }
  28. this.#description = target;
  29. }
  30. add_solid(target) {
  31. }
  32. }
  33. export { element_builder };