public void SlotCard(UICardSlot slot, Card card) { // Data handling currentPlayer.commandLine.SlotCard(slot.index, card); // UI handling slot.SlotCard(card); }
public void SlotCurrentCard(UICardSlot slot) { cards.Remove(currentCard); slot.SlotCard(currentCard); if (cards.Count < 1) { Hide(); } }
public void SwapCards(UICardSlot otherSlot) { List <UICard> temp = cards; cards = otherSlot.cards; otherSlot.cards = temp; ReplaceCards(); otherSlot.ReplaceCards(); }
// TODO: Cut into smaller parts public void CardSlotInteracted(UICardSlot slot) { if (UIMaster.Instance.state == UIMaster.UIState.Slot) { if ((currentTurnState as TurnState_Draft).draftStage > 0 && currentPlayer.currentCard != null && currentPlayer.commandLine.CanSlotCard(slot.index, currentPlayer.currentCard)) { currentPlayer.hand.Remove(currentPlayer.currentCard); currentPlayer.commandLine.SlotCard(slot.index, currentPlayer.currentCard); currentPlayer.currentCard = null; UIMaster.Instance.handPanel.SlotCurrentCard(slot); (currentTurnState as TurnState_Draft).CardSlotted(); } } else if (UIMaster.Instance.state == UIMaster.UIState.ScrapRepair) { if (currentPlayer.commandLine.cards[slot.index].Count > 0 && currentPlayer.commandLine.cards[slot.index].PeekTop() is DamageCard) { RepairCommandSlot(currentPlayer, slot.index); UIMaster.Instance.handPanel.RemoveCard(currentPlayer.currentCard); commandCardDeck.DiscardCard(currentPlayer.currentCard as CommandCard); UIMaster.Instance.ToggleRepairScrap(currentPlayer, false); (currentTurnState as TurnState_Draft).CardSlotted(); UpdateUIState(); } } else if (UIMaster.Instance.state == UIMaster.UIState.ScrapSwap) { if (currentPlayer.commandLine.cards[slot.index].Count == 0 || !(currentPlayer.commandLine.cards[slot.index].PeekTop() is DamageCard)) { UICardSlot slot1 = UIMaster.Instance.SelectedSwapItem; if (slot1 == null) { UIMaster.Instance.SwapScrapInteraction(slot); } else if (slot1 != slot) { SwapSlots(currentPlayer, slot1.index, slot.index); currentPlayer.hand.Remove(currentPlayer.currentCard); UIMaster.Instance.handPanel.RemoveCard(currentPlayer.currentCard); commandCardDeck.DiscardCard(currentPlayer.currentCard as CommandCard); UIMaster.Instance.SelectedSwapItem = null; UIMaster.Instance.ToggleSwapScrap(currentPlayer, false); (currentTurnState as TurnState_Draft).CardSlotted(); UpdateUIState(); } } } }
public void SwapScrapInteraction(UICardSlot slot) { selectedSwapItem = slot; slot.SetHighlightState(UIHighlight.HighlightState.Selected); }