|
@@ -1,7 +1,4 @@
|
|
|
-import { lang } from "./lang.js";
|
|
|
|
|
-
|
|
|
|
|
class element {
|
|
class element {
|
|
|
- #id;
|
|
|
|
|
#pictures;
|
|
#pictures;
|
|
|
#mesh;
|
|
#mesh;
|
|
|
#name;
|
|
#name;
|
|
@@ -10,34 +7,36 @@ class element {
|
|
|
#links;
|
|
#links;
|
|
|
#thumbnail;
|
|
#thumbnail;
|
|
|
|
|
|
|
|
- constructor(id) {
|
|
|
|
|
- if (typeof(id) !== "number") {
|
|
|
|
|
- throw "ID must be number.";
|
|
|
|
|
|
|
+ constructor(name) {
|
|
|
|
|
+ if (typeof(name) !== "string") {
|
|
|
|
|
+ throw "Name must be an string.";
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- this.#id = id;
|
|
|
|
|
|
|
+
|
|
|
|
|
+ this.#name = name;
|
|
|
|
|
+
|
|
|
|
|
+ this.#description = "";
|
|
|
|
|
+ this.#mesh = "";
|
|
|
|
|
+ this.#thumbnail = "";
|
|
|
|
|
+
|
|
|
this.#pictures = new Set();
|
|
this.#pictures = new Set();
|
|
|
this.#params = new Map();
|
|
this.#params = new Map();
|
|
|
this.#links = new Map();
|
|
this.#links = new Map();
|
|
|
- this.#name = undefined;
|
|
|
|
|
- this.#mesh = undefined;
|
|
|
|
|
- this.#thumbnail = undefined;
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- get id() {
|
|
|
|
|
- return this.#id;
|
|
|
|
|
|
|
+ get name() {
|
|
|
|
|
+ return this.#name;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ get description() {
|
|
|
|
|
+ return this.#description;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- set name(content) {
|
|
|
|
|
|
|
+ set description(content) {
|
|
|
if (typeof(content) !== "string") {
|
|
if (typeof(content) !== "string") {
|
|
|
- throw "Name must be string.";
|
|
|
|
|
|
|
+ throw "Description must be an string.";
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- this.#name = content;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- get name() {
|
|
|
|
|
- return this.#name;
|
|
|
|
|
|
|
+ this.#description = content;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
get mesh() {
|
|
get mesh() {
|
|
@@ -52,16 +51,16 @@ class element {
|
|
|
this.#mesh = content;
|
|
this.#mesh = content;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ get thumbnail() {
|
|
|
|
|
+ return this.#thumbnail;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
set thumbnail(content) {
|
|
set thumbnail(content) {
|
|
|
if (typeof(content) !== "string") {
|
|
if (typeof(content) !== "string") {
|
|
|
throw "Thumbnail URL must be string.";
|
|
throw "Thumbnail URL must be string.";
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- get thumbnail() {
|
|
|
|
|
- return this.#thumbnail;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
get links() {
|
|
get links() {
|
|
|
return this.#links;
|
|
return this.#links;
|
|
|
}
|
|
}
|