diff --git a/pkg/data/objects.go b/pkg/data/objects.go index c9d647d..9bc548e 100644 --- a/pkg/data/objects.go +++ b/pkg/data/objects.go @@ -24,6 +24,16 @@ func (o Objects) FindOne(name object.Name) (Object, bool) { return Object{}, false } +func (o Objects) FindByID(id UnitID) (Object, bool) { + for _, obj := range o { + if obj.ID == id { + return obj, true + } + } + + return Object{}, false +} + func (o Object) IsWaypoint() bool { switch o.Name { case object.WaypointPortal,