<?php

namespace Shm\ShmTypes\CompositeTypes;

use Shm\Shm;
use Shm\ShmTypes\StructureType;

class HallType extends StructureType
{
    public string $type = 'hall';


    public bool $compositeType = true;




    public function __construct()
    {



        parent::__construct([

            'version' => Shm::int(),
            'belts' => Shm::arrayOf(Shm::structure([
                'id' =>  Shm::nonNull(Shm::string()),
                'name' => Shm::nonNull(Shm::string()),
                'color' => Shm::nonNull(Shm::string()),
            ])->staticBaseTypeName("HallBelt")),

            'elements' => Shm::arrayOf(Shm::structure([
                'id' => Shm::nonNull(Shm::string()),
                'type' => Shm::enum([
                    'seat' => "Место",
                    'table' => "Стол",
                    'stage' => "Сцена",
                    'wall' => "Стена/Разделитель",
                    'sector' => "Сектор",
                    'zone' => "Зона (входной билет, без места)",
                ]),
                'x' =>  Shm::nonNull(Shm::float()),
                'y' =>  Shm::nonNull(Shm::float()),
                'width' =>  Shm::nonNull(Shm::float()),
                'height' =>  Shm::nonNull(Shm::float()),
                'rotation' =>  Shm::nonNull(Shm::float()),
                'label' => Shm::nonNull(Shm::string()),
                'seatNumber' => Shm::string(),
                'seatRow' => Shm::string(),
                'beltId' => Shm::string(),
                'sectorId' => Shm::string(),
                'sectorName' => Shm::string(),
                'capacity' => Shm::int(),

            ])->staticBaseTypeName("HallElement")),

        ]);
        $this->staticBaseTypeName("Hall");
    }
}