package fr.titionfire.ffsaf.ws.send;

import fr.titionfire.ffsaf.domain.entity.MatchEntity;
import fr.titionfire.ffsaf.ws.CompetitionWS;
import fr.titionfire.ffsaf.ws.recv.RMatch;
import io.quarkus.websockets.next.WebSocketConnection;

import java.util.List;

public class SSMatch {

    public static void sendMatch(WebSocketConnection connection, MatchEntity matchEntity) {
        SSMatch.sendMatch(connection, List.of(matchEntity));
    }

    public static void sendMatch(WebSocketConnection connection, List<MatchEntity> matchEntities) {
        CompetitionWS.sendNotifyToOtherEditor(connection, "sendMatch", matchEntities);
    }

    public static void sendMatchOrder(WebSocketConnection connection, RMatch.MatchOrder  matchOrder) {
        CompetitionWS.sendNotifyToOtherEditor(connection, "sendMatchOrder", matchOrder);
    }

    public static void sendDeleteMatch(WebSocketConnection connection, Long l) {
        SSMatch.sendDeleteMatch(connection, List.of(l));
    }

    public static void sendDeleteMatch(WebSocketConnection connection, List<Long> longs) {
        CompetitionWS.sendNotifyToOtherEditor(connection, "sendDeleteMatch", longs);
    }
}
