2022-11-11 14:22:34 +00:00
|
|
|
package distribution
|
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
|
|
|
|
}
|
2022-11-03 20:12:26 +00:00
|
|
|
|
|
|
|
func ArgToStr(a Argument) string {
|
|
|
|
return a.Body + " " + a.Value
|
|
|
|
}
|