Switching from "name" to "id" in texture object + using zod for woka/list validation

This commit is contained in:
David Négrier
2022-02-25 17:05:34 +01:00
parent da469b64d2
commit 08fffab410
11 changed files with 57 additions and 69 deletions
+4 -3
View File
@@ -5,7 +5,8 @@ export interface BodyResourceDescriptionListInterface {
}
export interface BodyResourceDescriptionInterface {
name: string;
id: string;
label: string;
img: string;
level?: number;
}
@@ -89,7 +90,7 @@ export class PlayerTextures {
const resources: BodyResourceDescriptionListInterface = {};
for (const collection of category.collections) {
for (const texture of collection.textures) {
resources[texture.id] = { name: texture.name, img: texture.url };
resources[texture.id] = { id: texture.id, label: texture.name, img: texture.url };
}
}
return resources;
@@ -97,5 +98,5 @@ export class PlayerTextures {
}
export const OBJECTS: BodyResourceDescriptionInterface[] = [
{ name: "teleportation", img: "resources/objects/teleportation.png" },
{ id: "teleportation", label: "Teleport", img: "resources/objects/teleportation.png" },
];