sharedutils/gameUtils/gameUtils.go

32 lines
670 B
Go
Raw Normal View History

2022-10-27 20:31:39 +00:00
package gameUtils
2022-10-27 18:05:45 +00:00
2022-10-27 20:31:39 +00:00
func FindGameByID(id string, list Games) SteamGame {
for _, game := range list.SteamGames {
if game.GameId == id {
return game
}
}
var temp SteamGame = SteamGame{}
return temp
}
2022-10-27 18:05:45 +00:00
// func findSteamGameByID(id string) SteamGame {
// for _, game := range localGames.St {
// if game.GameId == id {
// return game
// }
// }
// var game SteamGame = SteamGame{}
// return game
// }
func GetJSGameInterface(game SteamGame) JSGameInterface {
newInterface := JSGameInterface{
GameID: game.GameId,
Title: game.Assets.Title,
2022-10-28 15:23:04 +00:00
Icon: game.Assets.Icon,
2022-10-27 18:05:45 +00:00
Description: game.Assets.Description,
}
return newInterface
}