<?php

namespace App\Enums;

enum RollerCoasterType: string
{
    case SITDOWN = 'SITDOWN';
    case INVERTED = 'INVERTED';
    case FLYING = 'FLYING';
    case STANDUP = 'STANDUP';
    case WING = 'WING';
    case DIVE = 'DIVE';
    case FAMILY = 'FAMILY';
    case WILD_MOUSE = 'WILD_MOUSE';
    case SPINNING = 'SPINNING';
    case FOURTH_DIMENSION = 'FOURTH_DIMENSION';
    case OTHER = 'OTHER';

    public function label(): string
    {
        return match($this) {
            self::SITDOWN => 'Sit Down',
            self::INVERTED => 'Inverted',
            self::FLYING => 'Flying',
            self::STANDUP => 'Stand Up',
            self::WING => 'Wing',
            self::DIVE => 'Dive',
            self::FAMILY => 'Family',
            self::WILD_MOUSE => 'Wild Mouse',
            self::SPINNING => 'Spinning',
            self::FOURTH_DIMENSION => '4th Dimension',
            self::OTHER => 'Other',
        };
    }

    public static function values(): array
    {
        return array_column(self::cases(), 'value');
    }

    public static function labels(): array
    {
        return array_map(fn($case) => $case->label(), self::cases());
    }

    public static function options(): array
    {
        return array_combine(self::values(), self::labels());
    }
}