只允许八张卡组
This commit is contained in:
@@ -442,6 +442,7 @@ namespace TcgEngine.UI
|
||||
RefreshCardsQuantities();
|
||||
}
|
||||
|
||||
// 刷新新手卡组
|
||||
private void RefreshStarterDeck()
|
||||
{
|
||||
UserData udata = Authenticator.Get().UserData;
|
||||
@@ -517,8 +518,32 @@ namespace TcgEngine.UI
|
||||
return null;
|
||||
}
|
||||
|
||||
// 保存卡组
|
||||
private void SaveDeck()
|
||||
{
|
||||
// TODO 添加通知
|
||||
int totalCardCount = 0;
|
||||
foreach (UserCardData card in deck_cards)
|
||||
{
|
||||
totalCardCount += card.quantity;
|
||||
}
|
||||
|
||||
Debug.Log("用户选择的卡牌总数量: " + totalCardCount);
|
||||
Debug.Log("用户选择的卡牌种类数量: " + deck_cards.Count);
|
||||
|
||||
if (totalCardCount == 0)
|
||||
{
|
||||
Debug.Log("卡组为空,无法保存");
|
||||
return;
|
||||
}
|
||||
|
||||
if (totalCardCount != GameplayData.Get().deck_size)
|
||||
{
|
||||
Debug.Log("卡组数量错误,无法保存。当前总数: " + totalCardCount + ", 需要: " + GameplayData.Get().deck_size);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
UserData udata = Authenticator.Get().UserData;
|
||||
UserDeckData udeck = new UserDeckData();
|
||||
udeck.tid = current_deck_tid;
|
||||
|
||||
Reference in New Issue
Block a user