<?php

namespace App\Form;

use App\Entity\Event;
use App\Entity\Game;
use App\Entity\Gamemaster;
use App\Entity\Party;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Form\Extension\Core\Type\DateTimeType;

class PartyType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options): void
    {
        $builder
            ->add('description', null, [
                'label' => 'Description',
                'label_attr' => ['class' => 'label'],
                'help' => 'Description sommaire de la partie.',
                'attr' => ['class' => 'textarea',
                           'rows' => 6],
                'required' => false,
                'row_attr' => ['class' => 'field'],
                'help_attr' => ['class' => 'help'],
            ])
//             ->add('gamemasterIsAuthor', null, [
//                 'label' => 'le(a) MJ est l\'auteur(rice) du jeu',
//                 'label_attr' => ['class' => 'checkbox'],
//                 'help' => 'Cochez si par partie est animée par l\'auteur(rice) du jeu.',
//                 'attr' => ['class' => 'checkbox'],
//                 'row_attr' => ['class' => 'field'],
//                 'help_attr' => ['class' => 'help'],
//             ])
            ->add('minParticipants', null, [
                'label' => 'Nombre minimum de participant(e)s',
                'help' => 'Nombre minimum de participant(e)s pour permettre de jouer la partie.',
                'required' => true,
                'label_attr' => ['class' => 'label'],
                'attr' => ['class' => 'input'],
                'row_attr' => ['class' => 'field'],
                'help_attr' => ['class' => 'help'],               
            ])
            ->add('maxParticipants', null, [
                'label' => 'Nombre maximum de participant(e)s',
                'help' => 'Nombre maximum de participant(e)s pouvant jouer cette partie.',
                'required' => true,
                'label_attr' => ['class' => 'label'],
                'attr' => ['class' => 'input'],
                'row_attr' => ['class' => 'field'],
                'help_attr' => ['class' => 'help'],               
            ])
        ;
    }

    public function configureOptions(OptionsResolver $resolver): void
    {
        $resolver->setDefaults([
            'data_class' => Party::class,
        ]);
    }
}
