public static void UpdateGame(PLGame g) { SLGame.Game newGame = DTO_to_SL(g); SLGame.ISLGame SLGame = new SLGame.SLGameClient(); string[] errors = new string[0]; SLGame.UpdateGame(newGame, ref errors); }
private static SLGame.Game DTO_to_SL(PLGame game) { SLGame.Game SLGame = new SLGame.Game(); SLGame.matchup = game.matchup; SLGame.time = Convert.ToDateTime(game.time); SLGame.length = game.length; SLGame.downloadCount = game.downloadCount; SLGame.player1 = new SLGame.Player(); SLGame.player1.id = Convert.ToInt32(game.player1_id); SLGame.player1.name = game.player1Name; SLGame.player1.code = Convert.ToInt32(game.player1Code); SLGame.player1.league = new SLGame.League(); SLGame.player1.league.id = Convert.ToInt32(game.player1_league_id); SLGame.player1.league.name = game.player1League; SLGame.player1.race = new SLGame.Race(); SLGame.player1.race.id = Convert.ToInt32(game.player1_race_id); SLGame.player1.race.name = game.player1Race; SLGame.player1.race.code = Convert.ToChar(game.player1RaceCode); SLGame.player1_race = SLGame.player1.race; SLGame.player2 = new SLGame.Player(); SLGame.player2.id = Convert.ToInt32(game.player2_id); SLGame.player2.name = game.player2Name; SLGame.player2.code = Convert.ToInt32(game.player2Code); SLGame.player2.league = new SLGame.League(); SLGame.player2.league.id = Convert.ToInt32(game.player2_league_id); SLGame.player2.league.name = game.player2League; SLGame.player2.race = new SLGame.Race(); SLGame.player2.race.id = Convert.ToInt32(game.player2_race_id); SLGame.player2.race.name = game.player2Race; SLGame.player2.race.code = Convert.ToChar(game.player2RaceCode); SLGame.player2_race = SLGame.player2.race; if (game.winnerName == game.player1Name) { SLGame.winner = SLGame.player1; } else { SLGame.winner = SLGame.player2; } SLGame.map = new SLGame.Map(); SLGame.map.id = Convert.ToInt32(game.map_id); SLGame.map.name = game.map; SLGame.map.spawns = Convert.ToInt32(game.spawns); SLGame.map.size = game.size; return SLGame; }