示例#1
0
        public void BajaPlayer(Players p)
        {
            c = new GameModelContainer();
            var a = c.PlayerSet.Where(k => k.Id == p.Id).Single();

            c.PlayerSet.Remove(a);
            c.SaveChanges();
        }
示例#2
0
        public void Comprar(int id, double fichas)
        {
            c = new GameModelContainer();
            var original = c.PlayerSet.Find(id);

            if (original != null)
            {
                original.Fichas   += fichas;
                original.Efectivo -= fichas;
                c.SaveChanges();
            }
        }
示例#3
0
        public void Guardar(int id, int fichas, Boolean victoria)
        {
            c = new GameModelContainer();
            var original = c.PlayerSet.Find(id);

            if (original != null)
            {
                original.Fichas += fichas;
                original.Jugadas++;
                if (victoria)
                {
                    original.Victorias++;
                }
                c.SaveChanges();
            }
        }
示例#4
0
 public void AltaPlayer(Players p)
 {
     c = new GameModelContainer();
     c.PlayerSet.Add(p);
     c.SaveChanges();
 }