Added Entrance/Stairs unittype5 table lvlwrap.txt (#64)
This commit is contained in:
33
pkg/data/entrances.go
Normal file
33
pkg/data/entrances.go
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user