package com.ghost.technic.server.card.keyword.impl;

import com.ghost.technic.server.Player;
import com.ghost.technic.server.card.keyword.KeywordEffect;
import com.ghost.technic.server.card.playable.PlayableCard;
import com.ghost.technic.server.game.GameActionService;

public class ScrapEffect implements KeywordEffect {
    @Override
    public void onPlay(GameActionService service, PlayableCard card, Player controller) {
        if (!service.isPlayedFromDiscard(card)) {
            throw new IllegalStateException("Scrap effects only trigger when played from discard.");
        }
        service.resolveScrapEffect(card);
    }
}
