Added Entrance/Stairs unittype5 table lvlwrap.txt (#64)

This commit is contained in:
elb
2024-12-23 13:06:15 -05:00
committed by GitHub
parent 8203394c9f
commit 2924189fe8
10 changed files with 378 additions and 0 deletions

33
pkg/data/entrances.go Normal file
View File

@@ -0,0 +1,33 @@
package data
import (
"github.com/hectorgimenez/d2go/pkg/data/entrance"
)
type Entrance struct {
ID UnitID
entrance.Name
IsHovered bool
Selectable bool
Position Position
}
type Entrances []Entrance
func (e Entrances) FindOne(name entrance.Name) (Entrance, bool) {
for _, ent := range e {
if ent.Name == name {
return ent, true
}
}
return Entrance{}, false
}
func (e Entrances) FindByID(id UnitID) (Entrance, bool) {
for _, ent := range e {
if ent.ID == id {
return ent, true
}
}
return Entrance{}, false
}