diff --git a/src/components/GameWindow.vue b/src/components/GameWindow.vue index 6278628..c607646 100644 --- a/src/components/GameWindow.vue +++ b/src/components/GameWindow.vue @@ -6,26 +6,12 @@ import VueQrcode from '@chenfengyuan/vue-qrcode'; import BeltBlock from './BeltBlock.vue'; import MetalPlate from './MetalPlate.vue'; import GameHeader from './GameHeader.vue'; -import type { Application } from './application'; +import type { Action } from './action'; import type { Door } from './door'; const router = useRouter(); const route = useRoute(); -type Action = { - id: string - place: string - name: string - text: string - image: string - applications: Application[] - hidden: boolean - doors: Door[] - - isOpen: boolean - buttons: Door[] -} - type Team = { name: string actions: Action[] @@ -94,7 +80,7 @@ function getTeam() { } for (let i = 0; i < team.value.actions.length; i++) { const element = team.value.actions[i]; - team.value.actions[i].buttons = element.doors.filter((door) => { return door.show }) + team.value.actions[i].buttons = element.doors.filter((door: Door) => { return door.show }) } }) .catch(error => { diff --git a/src/components/action.ts b/src/components/action.ts new file mode 100644 index 0000000..a70301d --- /dev/null +++ b/src/components/action.ts @@ -0,0 +1,29 @@ +import type { Application } from './application' +import type { Door } from './door' + +// Действие +// Посещение точки игры +export type Action = { + // Идентификатор действия + id: string + // Код точки + place: string + // Название точки + name: string + // Текст точки + text: string + // Ссылка на картинку + image: string + // Список приложений + applications: Application[] + // Видимость/доступность точки + hidden: boolean + // Двери точки + doors: Door[] + + // Поля для интерфейса + // Сворачивание + isOpen: boolean + // Кнопки + buttons: Door[] +}