nquest/api/mapper.go

26 lines
389 B
Go
Raw Normal View History

2023-11-01 23:21:12 +03:00
package api
2024-01-05 03:50:33 +03:00
import (
"gitrepo.ru/neonxp/nquest/pkg/models"
)
2023-11-01 23:21:12 +03:00
2024-01-05 03:50:33 +03:00
func MapGameType(typ GameType) models.GameType {
switch typ {
case City:
return models.CityGame
case Virtual:
return models.VirtualGame
2023-11-01 23:21:12 +03:00
}
2024-01-05 03:50:33 +03:00
return 0
}
2023-11-01 23:21:12 +03:00
2024-01-05 03:50:33 +03:00
func MapGameTypeReverse(typ models.GameType) GameType {
switch typ {
case models.CityGame:
return City
case models.VirtualGame:
return Virtual
2023-11-01 23:21:12 +03:00
}
2024-01-05 03:50:33 +03:00
return ""
2023-11-01 23:21:12 +03:00
}