Create CardDatabase
This commit is contained in:
parent
18cfff1135
commit
246b2471f4
6 changed files with 50 additions and 17 deletions
20
Assets/Battle/CardDatabase.cs
Normal file
20
Assets/Battle/CardDatabase.cs
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public enum CardId {
|
||||
CrashingPunch
|
||||
}
|
||||
|
||||
public class CardDatabase
|
||||
{
|
||||
public static BaseCard CreateCard(CardId id) {
|
||||
switch (id)
|
||||
{
|
||||
case CardId.CrashingPunch:
|
||||
return new CardCrashingPunch();
|
||||
default:
|
||||
throw new System.ArgumentException("CardId unknown", "id");
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue