mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-14 13:12:23 +00:00
feat(training): add opt-in teamplay evaluation
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
extends TestCase
|
||||
|
||||
const ShipAIControllerScript = preload("res://scripts/ship_ai_controller.gd")
|
||||
|
||||
func test_team_touch_credit_is_split_across_teammates() -> void:
|
||||
assert_eq(ShipAIControllerScript.team_touch_credit(0.8, 0.5, 2), 0.2, "half-weight touch is split between two teammates")
|
||||
|
||||
func test_team_touch_credit_never_exceeds_touch_payout() -> void:
|
||||
var credit := ShipAIControllerScript.team_touch_credit(0.8, 1.0, 1)
|
||||
assert_eq(credit, 0.8, "one teammate receives at most the touch payout")
|
||||
|
||||
func test_team_touch_credit_rejects_invalid_inputs() -> void:
|
||||
assert_eq(ShipAIControllerScript.team_touch_credit(0.8, 0.0, 2), 0.0, "zero weight is disabled")
|
||||
assert_eq(ShipAIControllerScript.team_touch_credit(0.8, 0.5, 0), 0.0, "no teammates receive no credit")
|
||||
assert_eq(ShipAIControllerScript.team_touch_credit(-1.0, 0.5, 2), 0.0, "negative payout cannot mint reward")
|
||||
|
||||
func test_team_touch_credit_clamps_weight() -> void:
|
||||
assert_eq(ShipAIControllerScript.team_touch_credit(0.8, 2.0, 2), 0.4, "weight above one is clamped")
|
||||
Reference in New Issue
Block a user