<?php

namespace App\Model;

final class OrganizationalUnitP2PModes
{
    public const string P2P_MODE_LEECHER = 'leecher';
    public const string P2P_MODE_PEER = 'peer';
    public const string P2P_MODE_SEEDER = 'seeder';

    private const array P2P_MODE_NAMES = [
        self::P2P_MODE_LEECHER => 'El cliente no comparte mientras descarga la imagen',
        self::P2P_MODE_PEER => 'El cliente, mientras descarga la imagen, comparte los datos que ya tenga descargados',
        self::P2P_MODE_SEEDER => 'Modo de trabajo en modo distribuido',
    ];

    public static function getP2pModeNames(): array
    {
        return self::P2P_MODE_NAMES;
    }

    public static function getP2pModeName(string $p2pMode): ?string
    {
        return self::P2P_MODE_NAMES[$p2pMode] ?? null;
    }

    public static function getP2pModes(): array
    {
        return array_keys(self::P2P_MODE_NAMES);
    }
}