48 lines
1.2 KiB
C#
48 lines
1.2 KiB
C#
using System;
|
|
using UnityEngine;
|
|
|
|
namespace Gameplay
|
|
{
|
|
public class CardBook
|
|
{
|
|
public CardBookData Data;
|
|
public CardSlot[] Slots;
|
|
public CardSlot[] Spares;
|
|
|
|
public CardBook(CardBookData data)
|
|
{
|
|
Data = data;
|
|
Slots = new CardSlot[Data.SlotCount];
|
|
Spares = new CardSlot[Data.SpareCount];
|
|
for (int i = 0; i < Slots.Length; i++)
|
|
{
|
|
Slots[i] = new CardSlot();
|
|
}
|
|
for (int i = 0; i < Spares.Length; i++)
|
|
{
|
|
Spares[i] = new CardSlot();
|
|
}
|
|
}
|
|
|
|
// Get all cards in the card book,and not Spares
|
|
public Card[] GetCards()
|
|
{
|
|
var cards = new Card[Slots.Length + Spares.Length];
|
|
for (int i = 0; i < Slots.Length; i++)
|
|
{
|
|
cards[i] = Slots[i].StoredCard;
|
|
}
|
|
return cards;
|
|
}
|
|
|
|
public Card[] GetSpareCards()
|
|
{
|
|
var cards = new Card[Spares.Length + Spares.Length];
|
|
for (int i = 0; i < Spares.Length; i++)
|
|
{
|
|
cards[i] = Spares[i].StoredCard;
|
|
}
|
|
return cards;
|
|
}
|
|
}
|
|
} |