scoring implemented; clients calculate scores individually and display ranks per player

This commit is contained in:
2025-07-16 11:15:05 +02:00
parent 72b68dd6f0
commit cc7afb5477
11 changed files with 80 additions and 3 deletions
+8
View File
@@ -23,6 +23,14 @@ func _ready() -> void:
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 = {}