package play

import (
	"game-driver/internal/middleware"
	"game-driver/internal/schema"
	"game-driver/leaf"
	"time"
)

func Default(c *leaf.Context) {
	payload := leaf.Value[*schema.PlayModal](c, middleware.PayloadJSONKey)

	if w, ok := payload.Game["wait"]; ok {
		if v, ok := w.(float64); ok {
			select {
			case <-c.Done():
			case <-time.After(time.Duration(v) * time.Second):
			}
		}
	}
}
