Implement TargetingPolicy, Cover can only target other allies

This commit is contained in:
henriquenakashima 2020-09-19 16:02:38 -04:00
parent 611601934d
commit 3e0004d4cb
21 changed files with 151 additions and 26 deletions

View file

@ -9,15 +9,24 @@ public enum CardId {
public class CardDatabase
{
public static BaseCard CreateCard(CardId id) {
private static Dictionary<CardId, HeroId> CARD_TO_HERO = new Dictionary<CardId, HeroId>() {
{CardId.CrashingPunch, HeroId.Brute},
{CardId.Cover, HeroId.Brute},
};
public static BaseCard CreateCard(CardId id, BattleParticipant owner) {
switch (id)
{
case CardId.CrashingPunch:
return new CardCrashingPunch();
return new CardCrashingPunch(owner);
case CardId.Cover:
return new CardCover();
return new CardCover(owner);
default:
throw new System.ArgumentException("CardId unknown", "id");
}
}
public static HeroId GetHeroIdOfCard(CardId id) {
return CARD_TO_HERO[id];
}
}