IBattleEffectResolver takes in the effects as params
This commit is contained in:
parent
8b539e1b5c
commit
c2e8b526b6
6 changed files with 43 additions and 33 deletions
|
|
@ -16,9 +16,13 @@ public class AcquireCardsEffect : IBattleEffect
|
|||
|
||||
public void Apply(IBattleEffectResolver resolver) {
|
||||
if (this.participant.IsHero()) {
|
||||
resolver.AcquireHeroCards(this.cardIds, this.zone, (BattleHero) this.participant);
|
||||
resolver.AcquireHeroCards(this);
|
||||
} else {
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
public CardId[] CardIds {get => this.cardIds;}
|
||||
public BattleZone Zone {get => this.zone;}
|
||||
public BattleParticipant Participant {get => this.participant;}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,6 +13,9 @@ public class BlockEffect : IBattleEffect
|
|||
}
|
||||
|
||||
public void Apply(IBattleEffectResolver resolver) {
|
||||
resolver.AddBlock(this.target, this.amount);
|
||||
resolver.AddBlock(this);
|
||||
}
|
||||
|
||||
public BattleParticipant Target {get => this.target;}
|
||||
public int Amount {get => this.amount;}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,13 +4,15 @@ using UnityEngine;
|
|||
|
||||
public class IncreaseMaxEnergyEffect : IBattleEffect
|
||||
{
|
||||
private int delta;
|
||||
private int amount;
|
||||
|
||||
public IncreaseMaxEnergyEffect(int delta) {
|
||||
this.delta = delta;
|
||||
public IncreaseMaxEnergyEffect(int amount) {
|
||||
this.amount = amount;
|
||||
}
|
||||
|
||||
public void Apply(IBattleEffectResolver resolver) {
|
||||
resolver.IncreaseHeroMaxEnergy(this.delta);
|
||||
resolver.IncreaseHeroMaxEnergy(this);
|
||||
}
|
||||
|
||||
public int Amount {get => this.amount;}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue