From 5e54ce45e7ff85fc83769febc45c6d5ef4a1ee91 Mon Sep 17 00:00:00 2001 From: denizk0461 Date: Sun, 20 Jul 2025 17:46:32 +0200 Subject: [PATCH] removed assert test queries --- cards/card_manager.gd | 25 ------------------------- elements/player_hand.gd | 21 --------------------- 2 files changed, 46 deletions(-) diff --git a/cards/card_manager.gd b/cards/card_manager.gd index d755754..ea7a348 100644 --- a/cards/card_manager.gd +++ b/cards/card_manager.gd @@ -7,31 +7,6 @@ enum CardStyle { STICKMAN, } -func _ready() -> void: - # magician wins - assert(get_winning_card([1, 2, 3, 59], -1) == 59) - assert(get_winning_card([1, 2, 3, 59], 3) == 59) - assert(get_winning_card([57, 2, 3, 59], 3) == 57) - # trump wins - assert(get_winning_card([1, 14, 2, 3], 4) == 3) - assert(get_winning_card([29, 14, 27, 31], 15) == 14) - assert(get_winning_card([1, 12, 6, 31], 30) == 31) - # joker win - assert(get_winning_card([54, 52, 55, 53], 31) == 54) - # other wins - assert(get_winning_card([14, 15, 18, 13], 16) == 18) - assert(get_winning_card([14, 15, 18, 13], 46) == 18) - # trumpless win - assert(get_winning_card([28, 12, 31, 13], -1) == 31) - - # score calculation tests - assert(BetResult.new(1, 1).get_score() == 30) - assert(BetResult.new(0, 0).get_score() == 20) - assert(BetResult.new(4, 4).get_score() == 60) - assert(BetResult.new(1, 2).get_score() == -10) - assert(BetResult.new(1, 4).get_score() == -30) - assert(BetResult.new(4, 1).get_score() == -30) - func get_shuffled_cards(client_ids: Array[String], cards_to_pick: int) -> Dictionary: # Dictionary[String, Array[int]] var dict: Dictionary = {} var deck: Array[int] = full_deck.keys() diff --git a/elements/player_hand.gd b/elements/player_hand.gd index 012933e..323d0c6 100644 --- a/elements/player_hand.gd +++ b/elements/player_hand.gd @@ -34,27 +34,6 @@ signal card_selected(card_id: int) signal card_played(card_id: int) func _ready() -> void: - # tests! - # tries playing same color - assert(_is_card_allowed(1, 3, [1, 15]) == true) - # tries playing trump while having same color - assert(_is_card_allowed(15, 3, [1, 15]) == false) - # tries playing trump while not having the same color - assert(_is_card_allowed(15, 3, [19, 15]) == true) - # tries playing first card - assert(_is_card_allowed(27, -1, [27, 1, 15]) == true) - # tries playing wizard as first - assert(_is_card_allowed(59, -1, [59, 1, 15]) == true) - # tries playing wizard as non-first - assert(_is_card_allowed(59, 3, [59, 1, 15]) == true) - # tries playing wizard after first is wizard - assert(_is_card_allowed(59, 58, [59, 1, 15]) == true) - # tries playing numbered after first is jester - assert(_is_card_allowed(3, 54, [3, 1, 15]) == true) - - assert(_is_card_allowed(13, 48, [13]) == true) - - if hide_client_name: name_label.hide()