package ludo

import (
	"server/game/internal"
	"server/msg"
)

func handleEvents() {
	// for event := range events.EventChan {
	// 	switch event.Type {
	// 	case events.EventLudoMatch:
	// 		userId := internal.GetUserIDByAgent(event.Agent)
	// 		if userId != "" {
	// 			if matchData, ok := event.Data.(*msg.MatchLudo); ok {
	// 				matchRoom(matchData, userId, event.Agent)
	// 			} else {
	// 				// Handle type assertion error
	// 				log.Printf("invalid match data type: %T", event.Data)
	// 			}
	// 		}

	// 	}
	// }

}

func init() {
	internal.Handler(&msg.SendColorSz{}, RecvPlayerSzNumber)

	internal.Handler(&msg.SendRoleMove{}, RecvPlayerRoleMove)

	internal.Handler(&msg.MatchLudo{}, RecvMatchLudo)

	internal.Handler(&msg.SendQuitRoom{}, RecvPlayerLeave)

	print("init event!")
}
