mixedcards/Assets/Battle/BaseCard.cs
2020-09-19 16:58:14 -04:00

48 lines
1.4 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public enum CardType {
Action,
Enchantment,
}
public abstract class BaseCard
{
protected BattleParticipant owner;
protected CardId id;
protected string displayName;
protected int cost;
protected CardType type;
protected string effectText;
public BaseCard(BattleParticipant owner, CardId id, string displayName, int cost, CardType type, string effectText) {
this.owner = owner;
this.id = id;
this.displayName = displayName;
this.cost = cost;
this.type = type;
this.effectText = effectText;
}
public abstract IEnumerator Use(IBattleEffectApplier effectApplier, BattlePlayerControls playerControls);
public CardId GetId() {return this.id;}
public string GetDisplayName() {return this.displayName;}
public int GetCost() {return this.cost;}
public string GetDisplayType() {
switch (this.type) {
case CardType.Action:
return "Action";
case CardType.Enchantment:
return "Enchantment";
default:
throw new System.ArgumentException("CardType unknown", "cardType");
}
}
public string GetEffectText() {return this.effectText;}
public bool IsPermanent() {
return this.type == CardType.Enchantment;
}
}