Ejemplo n.º 1
0
    protected BaseBattel Initialize(IBattel battel, IUserData player,
                                    BattelFieldFactory battelFieldFactory, ICardFactory <IAttackCard> cardFactory)
    {
        (this.Battel, this.UserData, this.battelFieldFactory, this.cardFactory)
            = (battel, player, battelFieldFactory, cardFactory);

        returnButton.SetListener(OnLeaveBattle);
        buttonFinishBattel.SetListener(OnLeaveBattle);
        buttonNextTurn.SetListener(NextTurn);

        buttonFinishBattel.gameObject.SetActive(false);
        buttonNextTurn.gameObject.SetActive(false);

        battel.InteractableButtonNextTurn += SetInteractableButtonNextTurn;
        battel.NextTurn     += NextTurn;
        battel.FinishBattel += FinishBattel;

        return(this);
    }