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

import com.ghost.technic.server.Player;
import com.ghost.technic.server.card.effect.CardAbility;
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.CreatureCard;
import com.ghost.technic.server.game.GameActionService;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class BulwarkAbility implements CardAbility {

    @Override
    public void register(GameActionService gameActionService, Player controller, PlayableCard source) {
        if (!(source instanceof CreatureCard bulwark)) return;

        BulwarkConstantAbility effect = new BulwarkConstantAbility(
                bulwark,
                controller.getPlayArea().getBattleline()
        );

        gameActionService.getGameState().registerStaticEffect(bulwark, effect);

        log.info("Registered Bulwark ability for {}", bulwark.getName());
    }
}
