This commit is contained in:
zomo
2025-12-18 01:26:45 -06:00
commit 658ad890f5
8 changed files with 474 additions and 0 deletions

29
assignroom.go Normal file
View File

@@ -0,0 +1,29 @@
package main
func AssignExtraRooms(rooms []RoomFolder, roomsPerNight int) {
latestnight := 0
for _, r := range rooms {
if r.cfg.night > latestnight {
latestnight = r.cfg.night
}
}
night := latestnight + 1
room := 1
for i, r := range rooms {
if r.cfg.night > 0 {
continue
}
rooms[i].cfg.night = night
rooms[i].cfg.room = room
room++
if room > roomsPerNight {
room = 1
night++
}
}
}