44 lines
1.3 KiB
C#
44 lines
1.3 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public enum CardId {
|
|
CrashingPunch,
|
|
Cover,
|
|
LightningStrike,
|
|
Scarring,
|
|
Thunderstorm,
|
|
}
|
|
|
|
public class CardDatabase
|
|
{
|
|
private static Dictionary<CardId, HeroId> CARD_TO_HERO = new Dictionary<CardId, HeroId>() {
|
|
{CardId.CrashingPunch, HeroId.Brute},
|
|
{CardId.Cover, HeroId.Brute},
|
|
{CardId.LightningStrike, HeroId.Shaman},
|
|
{CardId.Scarring, HeroId.Brute},
|
|
{CardId.Thunderstorm, HeroId.Shaman},
|
|
};
|
|
|
|
public static HeroCard CreateCard(CardId id, BattleParticipant owner) {
|
|
switch (id)
|
|
{
|
|
case CardId.CrashingPunch:
|
|
return new CardCrashingPunch(owner);
|
|
case CardId.Cover:
|
|
return new CardCover(owner);
|
|
case CardId.LightningStrike:
|
|
return new CardLightningStrike(owner);
|
|
case CardId.Scarring:
|
|
return new CardScarring(owner);
|
|
case CardId.Thunderstorm:
|
|
return new CardThunderstorm(owner);
|
|
default:
|
|
throw new System.ArgumentException("CardId unknown", "id");
|
|
}
|
|
}
|
|
|
|
public static HeroId GetHeroIdOfCard(CardId id) {
|
|
return CARD_TO_HERO[id];
|
|
}
|
|
}
|