-
-
Notifications
You must be signed in to change notification settings - Fork 101
Hand
Extends: CardContainer < Area2D
A type of CardContainer that stores its Card objects with full visibility to the player and provides methods for adding new ones and reorganizing them
const ExcessCardsBehaviour: Dictionary = {"ALLOW":1,"DISALLOW":0,"DISCARD_DRAWN":2,"DISCARD_OLDEST":3}
Specifies the behaviour to follow when trying to draw a card and we exceed our hand size
var bottom_margin: float
The maximum amount of cards allowed to draw in this hand Offsets the hand position based on the configuration
export var excess_discard_pile_name: String = ""
Specify the name of the pile to discard excess cards When "Discard Drawn" or "Discard Oldest" is specified in excess_cards
export var hand_size: int = 10
Specify the name of the pile to discard excess cards
When "Discard Drawn" or "Discard Oldest" is specified
in excess_cards
The maximum hand size. What happens if this is exceeded is determined
by excess_cards
export var excess_cards = 0
Specify the name of the pile to discard excess cards
When "Discard Drawn" or "Discard Oldest" is specified
in excess_cards
The maximum hand size. What happens if this is exceeded is determined
by excess_cards
Determines the behaviour of cards over the hand limit
- DISALLOWED: When hand is at limit, no more cards will be added to it
- ALLOWED: More cards than the limit can be added to the hand. The developer has to provide some logic on how to deal with the excess
- "DISCARD_DRAWN": When cards exceed the limit, the new card will be automatically discarded
- "DISCARD_OLDEST": When cards exceed the limit, the oldest card in the hand will be automatically discarded
func prepare_excess_discard_pile() -> void
func get_rightmost_card() -> Card
A wrapper for the CardContainer's get_last_card() which make sense for the cards' index in a hand
func get_leftmost_card() -> Card
A wrapper for the CardContainer's get_first_card() which make sense for the cards' index in a hand
func shuffle_cards() -> void
Visibly shuffles all cards in hand
func draw_card(pile: Pile) -> Card
Takes the top card from the specified CardContainer and adds it to this node Returns a card object drawn
func get_final_placement_node(card: Card) -> Node
func re_place() -> var
Overrides the re_place() function of CardContainer in order to also resize the hand rect, according to how many other CardContainers exist in the same row/column