只允许八张卡组

This commit is contained in:
xianyi
2025-08-05 10:51:35 +08:00
parent 2a46af9478
commit 28ba895a9d
9 changed files with 47 additions and 362 deletions

View File

@@ -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;

View File

@@ -75,6 +75,7 @@ namespace TcgEngine.UI
}
}
// 刷新新手卡组
private void RefreshStarterDeck()
{
UserData udata = Authenticator.Get().UserData;

View File

@@ -77,6 +77,7 @@ namespace TcgEngine.UI
GameClient.ai_settings.ai_level = GameplayData.Get().ai_level;
GameClient.game_settings.scene = GameplayData.Get().GetRandomArena();
// solo 休闲模式
MainMenu.Get().StartGame(GameType.Solo, GameMode.Casual);
}