Compare commits

..

No commits in common. "605da815cd37039112f0d5cf8d202702123702d2" and "6ef821481ee92c608fd2422861ce1a0332432f1e" have entirely different histories.

5 changed files with 27 additions and 20 deletions

View File

@ -3,16 +3,17 @@ package domain
import ( import (
"errors" "errors"
"git.gregbrzezinski.com/Skirda/skirdaGoLauncher/sharedutils/skirdasession" "git.gregbrzezinski.com/Skirda/sharedutils/games/skirdagame"
"git.gregbrzezinski.com/Skirda/sharedutils/skirdasession"
) )
type SkirdaDomain struct { type SkirdaDomain struct {
DomainId string DomainId string
SkirdaGames skirdagame.SkirdaGames
skirdasession.SkirdaSessions skirdasession.SkirdaSessions
} }
func (domain SkirdaDomain) BuildDomain(newGames []SkirdaGame, newSessions []skirdasession.SkirdaSession) { func (domain SkirdaDomain) BuildDomain(newGames []skirdagame.SkirdaGame, newSessions []skirdasession.SkirdaSession) {
domain.AddGames(newGames) domain.AddGames(newGames)
domain.AddSessions(newSessions) domain.AddSessions(newSessions)
} }
@ -23,7 +24,7 @@ func (domains Domains) Set(newDomains []SkirdaDomain) {
domains = append([]SkirdaDomain{}, newDomains...) domains = append([]SkirdaDomain{}, newDomains...)
} }
func (domains Domains) FindGameByID(gameId string) (SkirdaGame, error) { func (domains Domains) FindGameByID(gameId string) (skirdagame.SkirdaGame, error) {
for _, domain := range domains { for _, domain := range domains {
game, _ := domain.FindGameByID(gameId) game, _ := domain.FindGameByID(gameId)
if game.GetSkirdaGameId() == gameId { if game.GetSkirdaGameId() == gameId {
@ -34,8 +35,8 @@ func (domains Domains) FindGameByID(gameId string) (SkirdaGame, error) {
return nil, errors.New("") return nil, errors.New("")
} }
func (domains Domains) GetGames() SkirdaGames { func (domains Domains) GetGames() skirdagame.SkirdaGames {
allGames := SkirdaGames{} allGames := skirdagame.SkirdaGames{}
for _, domain := range domains { for _, domain := range domains {
allGames = append(allGames, domain.SkirdaGames...) allGames = append(allGames, domain.SkirdaGames...)
} }

View File

@ -1,10 +1,12 @@
package domain package minecraftgame
// const gameType = "minecraft" import "git.gregbrzezinski.com/Skirda/sharedutils/games/skirdagame"
const gameType = "minecraft"
type MinecraftGame struct { type MinecraftGame struct {
SkirdaGameId string SkirdaGameId string
Assets GameUIAssets Assets skirdagame.GameUIAssets
Versions []string Versions []string
} }
@ -12,7 +14,7 @@ func (game MinecraftGame) GetSkirdaGameId() string {
return game.SkirdaGameId return game.SkirdaGameId
} }
func (game MinecraftGame) GetUIAssets() GameUIAssets { func (game MinecraftGame) GetUIAssets() skirdagame.GameUIAssets {
return game.Assets return game.Assets
} }
@ -21,11 +23,11 @@ func (game MinecraftGame) GetLaunchArgs() []string {
} }
func (game MinecraftGame) GetType() string { func (game MinecraftGame) GetType() string {
return "minecraft" return gameType
} }
func (game MinecraftGame) GetArguments() Arguments { func (game MinecraftGame) GetArguments() skirdagame.Arguments {
return Arguments{} return skirdagame.Arguments{}
} }
func (game MinecraftGame) GetVersions() []string { func (game MinecraftGame) GetVersions() []string {

View File

@ -1,4 +1,4 @@
package domain package skirdagame
import "errors" import "errors"

View File

@ -1,10 +1,14 @@
package domain package steamgame
import "git.gregbrzezinski.com/Skirda/sharedutils/games/skirdagame"
const gameType = "steam"
type SteamGame struct { type SteamGame struct {
SkirdaGameId string SkirdaGameId string
SteamId string SteamId string
Assets GameUIAssets Assets skirdagame.GameUIAssets
Arguments Arguments Arguments skirdagame.Arguments
// CurrentVersion string // CurrentVersion string
} }
@ -12,7 +16,7 @@ func (game SteamGame) GetSkirdaGameId() string {
return game.SkirdaGameId return game.SkirdaGameId
} }
func (game SteamGame) GetUIAssets() GameUIAssets { func (game SteamGame) GetUIAssets() skirdagame.GameUIAssets {
return game.Assets return game.Assets
} }
@ -21,9 +25,9 @@ func (game SteamGame) GetLaunchArgs() []string {
} }
func (game SteamGame) GetType() string { func (game SteamGame) GetType() string {
return "steam" return gameType
} }
func (game SteamGame) GetArguments() Arguments { func (game SteamGame) GetArguments() skirdagame.Arguments {
return game.Arguments return game.Arguments
} }