package com.ghost.technic.server.board;

import com.ghost.technic.server.card.misc.House;
import com.ghost.technic.server.card.playable.PlayableCard;
import com.ghost.technic.server.card.playable.usable.impl.ArtifactCard;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;

@Data
@NoArgsConstructor
public class PlayArea {
    private Battleline battleline = new Battleline();
    private List<ArtifactCard> artifactCards = new ArrayList<>();

    public Set<House> getAllUsableCardsHouse() {
        var results = new HashSet<House>();
        var creatures = getBattleline().getCreatures().stream().map(PlayableCard::getHouse).collect(Collectors.toSet());
        var artifact = artifactCards.stream().map(PlayableCard::getHouse).collect(Collectors.toSet());
        results.addAll(creatures);
        results.addAll(artifact);
        return results;
    }
}
