sharedutils/utils/game/gameUtils.go

38 lines
914 B
Go

package gameUtils
import gamesModels "git.gregbrzezinski.com/Skirda/skirdagoutils/models/games"
func FindGameByID(id string, list gamesModels.Games) gamesModels.SteamGame {
for _, game := range list.SteamGames {
if game.GameId == id {
return game
}
}
var temp gamesModels.SteamGame = gamesModels.SteamGame{}
return temp
}
// 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 gamesModels.SteamGame) gamesModels.JSGameInterface {
newInterface := gamesModels.JSGameInterface{
GameID: game.GameId,
Title: game.Assets.Title,
Icon: game.Assets.Icon,
Description: game.Assets.Description,
}
return newInterface
}
func ArgToStr(a gamesModels.Argument) string {
return a.Body + " " + a.Value
}