18 lines
812 B
GDScript
18 lines
812 B
GDScript
extends SceneTree
|
|
|
|
const SPAWNER := preload("res://scripts/stage/stage_spawner.gd")
|
|
const CARD := preload("res://scripts/shared/ui/asset_card.gd")
|
|
var _failures: int = 0
|
|
|
|
func _init() -> void:
|
|
var world := Node2D.new()
|
|
var spawner = SPAWNER.new(world)
|
|
var entries: Array[Dictionary] = spawner.get_palette_entries()
|
|
_check(entries.size() == 6, "six registry cards")
|
|
_check(String(entries[0].get("placement_id", "")) == "ground", "registry id retained")
|
|
var card = CARD.new(); card.configure(entries[0]); _check(card.payload().get("kind", "") == "terrain", "card copies payload")
|
|
print("PASS" if _failures == 0 else "FAIL: %d" % _failures); quit(0 if _failures == 0 else 1)
|
|
|
|
func _check(condition: bool, message: String) -> void:
|
|
if not condition: _failures += 1; push_error("Phase 7 palette: " + message)
|