feat(): 大量更新
This commit is contained in:
48
Assets/Script/Gameplay/Card/CardBook/CardBook.cs
Normal file
48
Assets/Script/Gameplay/Card/CardBook/CardBook.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user