aboutsummaryrefslogtreecommitdiff
path: root/go
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2025-08-12 08:29:54 +0200
committerFlorian Fischer <florian.fischer@muhq.space>2025-08-12 08:29:54 +0200
commit906f26b753d20ba8f32f3e4c8e7759a2cb0ad958 (patch)
tree280f186afddd8957ca4af22f265ae98dbd55644d /go
parent8e87600190430bde15429f9aa2bf6d1dff2a8daa (diff)
downloadmuhqs-game-906f26b753d20ba8f32f3e4c8e7759a2cb0ad958.tar.gz
muhqs-game-906f26b753d20ba8f32f3e4c8e7759a2cb0ad958.zip
fixup! fix parsing of solid artifacts
Diffstat (limited to 'go')
-rw-r--r--go/game/artifact_test.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/go/game/artifact_test.go b/go/game/artifact_test.go
new file mode 100644
index 00000000..84c15652
--- /dev/null
+++ b/go/game/artifact_test.go
@@ -0,0 +1,21 @@
+package game
+
+import (
+ "testing"
+)
+
+func TestSolid(t *testing.T) {
+ p := NewArtifactFromPath("base/palisade", NewMockTile(), NewMockPlayer())
+ if !p.Attackable() {
+ t.Fatal("palisade not attackable")
+ }
+
+ if p.IsDestroyed() {
+ t.Fatal("palisade already destroyed")
+ }
+
+ p.adjustDamage(6)
+ if !p.IsDestroyed() {
+ t.Fatal("palisade not destroyed")
+ }
+}