diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2023-02-24 13:48:33 +0100 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2025-08-20 15:52:12 +0200 |
| commit | f58057564800cf45f61e3ab7c410385fcbf316df (patch) | |
| tree | 1babd0b9326ef72e842f0c2cecb2dda36a624213 /go/ui | |
| parent | d46f56fa0d8f2217cf9716839ee83b93f2ee8485 (diff) | |
| download | muhqs-game-f58057564800cf45f61e3ab7c410385fcbf316df.tar.gz muhqs-game-f58057564800cf45f61e3ab7c410385fcbf316df.zip | |
intermeditae commit
* implement dopping piles
* implement simple spell targeting
* add some simple spells
Diffstat (limited to 'go/ui')
| -rw-r--r-- | go/ui/collection.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/go/ui/collection.go b/go/ui/collection.go index 027d0d99..03920f34 100644 --- a/go/ui/collection.go +++ b/go/ui/collection.go @@ -5,6 +5,7 @@ import ( "github.com/hajimehoshi/ebiten/v2" "github.com/hajimehoshi/ebiten/v2/inpututil" + "golang.org/x/exp/slices" ) type Collection struct { @@ -33,6 +34,9 @@ func (c *Collection) AddWidget(w Widget) { if w == nil { log.Panicf("Adding nil widget to collection") } + if slices.Contains(c.widgets, w) { + log.Panicf("Double insertion of %v", w) + } c.widgets = append(c.widgets, w) } |
