Exemplo n.º 1
0
        public Game CreateGame(string host)
        {
            var game = new Game(host);
            _context.AddObject(Context.GAME, game);
            _context.SaveChanges();

            return game;
        }
Exemplo n.º 2
0
        public void Update(Game game)
        {
            Host0 = game.Host0;
            Host1 = game.Host1;
            Host2 = game.Host2;
            Host3 = game.Host3;
            Host4 = game.Host4;
            Host5 = game.Host5;
            Client0 = game.Client0;
            Client1 = game.Client1;
            Client2 = game.Client2;
            Client3 = game.Client3;
            Client4 = game.Client4;
            Client5 = game.Client5;

            ScoreHost = game.ScoreHost;
            ScoreClient = game.ScoreClient;

            State = game.State;

            Host = game.Host;
            Client = game.Client;
        }
Exemplo n.º 3
0
        public Game UpdateGame(string player, Game game)
        {
            var g = GetGame(game.RowKey);
            g.Update(game);

            var to = g.Host == player ? g.Client : g.Host;

            _context.UpdateObject(g);
            _context.SaveChanges();

            return g;
        }