1
0
Fork 0
impulse/internal/challenge/timers.go
2026-05-14 20:19:22 +03:00

21 lines
490 B
Go

package challenge
import "time"
func (e *Engine) startFloorTimer(p *Player, at time.Duration) {
if p.Floor >= 1 && p.Floor <= e.regularFloors && !e.floorCleared(p, p.Floor) {
p.floorTimerOn = true
p.floorTimerAt = at
}
}
func (e *Engine) pauseFloorTimer(p *Player, at time.Duration) {
if p.floorTimerOn {
p.FloorDurations[p.Floor] += at - p.floorTimerAt
p.floorTimerOn = false
}
}
func (e *Engine) finishFloorTimer(p *Player, at time.Duration) {
e.pauseFloorTimer(p, at)
}