-
-
Notifications
You must be signed in to change notification settings - Fork 101
Pile
Extends: CardContainer < Area2D
A type of CardContainer objects optional visibility to the player and provides methods for retrieving and viewing them
var is_popup_open: bool
export var pile_name: String = ""
-
Setter:
set_pile_name
The pile's name. If this value is changed, it will change the
pile_name_label
text.
export var shuffle_style = 0
The pile's name. If this value is changed, it will change the
pile_name_label
text.
The shuffle style chosen for this pile. See CFConst.ShuffleStyle documentation.
export var faceup_cards: bool = false
The pile's name. If this value is changed, it will change the
pile_name_label
text.
The shuffle style chosen for this pile. See CFConst.ShuffleStyle documentation.
If this is set to true, cards on this stack will be placed face-up.
Otherwise they will be placed face-down.
var pile_popup: Node
The popup node
var view_button: Node
Popup View button for Piles
var view_sorted_button: Node
Popup View button for Piles
var pile_name_label: Node
The label node where the pile_name is written.
var card_count_label: Node
The label node where the pile_name is written. The label node which shows the amount of cards in the pile.
var pre_sorted_order: Array
func populate_popup(sorted: bool = false) -> void
Populated the popup card viewer with the cards and displays them
func set_pile_name(value: String) -> void
Setter for pile_name.
Also sets pile_name_label
to the provided value.
func add_child(node, _legible_unique_name = false) -> void
Overrides the built-in add_child() method, To make sure the control node is set to be the last one among siblings. This way the control node intercepts any inputs.
Also checks if the popup window is currently open, and puts the card directly there in that case.
func remove_child(node, _legible_unique_name = false) -> void
Overrides the function which removed chilren nodes so that it detects when a Card class is removed. In that case it also shows this container's "floor" if it was the last card in the pile.
func reorganize_stack() -> void
Rearranges the position of the contained cards slightly so that they appear to be stacked on top of each other
func move_child(child_node, to_position) -> void
Override the godot builtin move_child() method, to make sure the $Control node is always drawn on top of Card nodes
func move_card_to_top(card: Card) -> void
The top position of a pile, is always the lowest
func get_all_cards(_scanViewPopup: bool = true) -> Array
Overrides CardContainer function to include cards in the popup window Returns an array with all children nodes which are of Card class
func get_top_card() -> Card
A wrapper for the CardContainer's get_last_card() which make sense for the cards' index in a pile
func get_bottom_card() -> Card
A wrapper for the CardContainer's get_first_card() which make sense for the cards' index in a pile
func get_stack_position(card: Card) -> Vector2
Returns the position among other cards the specified card should have.
func shuffle_cards(animate = true) -> var
Randomly rearranges the order of the Card nodes. Pile shuffling includes a fancy animation
func re_place() -> void
Overrides the re_place() function of Pile in order to also restack the cards
- signal popup_closed():