package scene import ( "git.aiterp.net/lucifer/new-server/models" "sync" ) type Manager struct { mu sync.Mutex assignments map[int]*Scene scenes []*Scene } func (mgr *Manager) UpdateDevice(device *models.Device) { } func (mgr *Manager) GetUnassigned(devices []models.Device) []models.Device { mgr.mu.Lock() defer mgr.mu.Unlock() res := make([]models.Device, 0, len(devices)) for _, device := range devices { if _, ok := mgr.assignments[device.ID]; !ok { res = append(res, device) } } return res } var globalManager = &Manager{} func Get() *Manager { return globalManager }