public void NewGame(DateTime date, int buyin, int? bounty, IEnumerable<Player> players) { ActiveGame = new Game { GameTime = date, Buyin = buyin, Bounty = bounty, Players = new List<GamePlayer>() }; if (players != null) foreach (Player p in players) ActiveGame.Players.Add(new GamePlayer { Player = p, Game = ActiveGame }); }
public static void ShowGame(Game game) { if (game == null) { Console.WriteLine("No game to display."); return; } Console.WriteLine("Game Date: {0}", game.GameTime.ToShortDateString()); Console.WriteLine("Game Time: {0}", game.GameTime.ToShortTimeString()); Console.WriteLine("Buyin: {0}", game.Buyin.ToString()); Console.WriteLine("Bounty: {0}", game.Bounty == null ? "None" : game.Bounty.ToString()); Console.WriteLine("Players: {0}", game.Players.Count().ToString()); foreach (GamePlayer p in game.Players) Console.WriteLine(p.Player.DisplayName); }
public void DeleteGame(Game b) { Connection.Delete<Game>(b); }
public void AddGame(Game b) { Connection.Insert<Game>(b); }
public void UpdateGame(Game b) { Connection.Update<Game>(b); }