| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- import { type_manager } from "./functions.js";
- class element {
- #name;
- #description;
- #pictures;
- #meshes;
- #solids;
- #order;
- constructor(
- name,
- description,
- pictures,
- meshes,
- solids,
- order
- ) {
- if (!type_manager.is_string(name)) {
- throw "Name of the element must be string.";
- }
- if (!type_manager.is_string(description)) {
- throw "Description of the element must be string.";
- }
- if (!type_manager.is_array(pictures)) {
- throw "Pictures must be array of files.";
- }
- if (!type_manager.is_array(meshes)) {
- throw "Meshes must be array of files.";
- }
- if (!type_manager.is_array(solids)) {
- throw "Solids must be array of files.";
- }
- if (!type_manager.is_array(order)) {
- throw "Order must be array of order.";
- }
- this.#name = name;
- this.#description = description;
- this.#pictures = pictures;
- this.#meshes = meshes;
- this.#solids = solids;
- this.#order = order;
- }
- get name() {
- return this.#name;
- }
- get description() {
- return this.#description;
- }
- get order() {
- return [...this.#order];
- }
- get pictures() {
- return [...this.#pictures];
- }
- get solids() {
- return [...this.#solids];
- }
- get meshes() {
- return [...this.#meshes];
- }
- }
- export { element };
|