Пример #1
0
        public void Update(Lanista lanista, Gladiator gladiator, string gladiatorName,
                           bool alive, bool win, bool killed)

        {
            Console.WriteLine("\n*Update Gladiator*");

            gladiator.LanistaId     = lanista.LanistaId;
            gladiator.GladiatorName = gladiatorName;

            DB.Gladiators.Update(gladiator);
            DB.SaveChanges();

            gladiator.Alive = alive;
            if (win == true)
            {
                gladiator.Wins += 1;
            }
            else
            {
                gladiator.Loss += 1;
            }
            if (killed == true)
            {
                gladiator.Kills += 1;
            }
        }
Пример #2
0
        public void Destroy(Gladiator gladiator)
        {
            Console.WriteLine("\n*Destroy Gladiator*");
            DB.Gladiators.Remove(gladiator);

            Console.WriteLine("Confirm Delete [y]: ");
            var key = Console.ReadKey();

            if (key.Key == ConsoleKey.Y)
            {
                DB.SaveChanges();
            }
        }
Пример #3
0
        /*public void ShopCreate(Shop shop)
         * {
         *  Console.WriteLine("\n*ShopCreate Gladiator*");
         *  var owner = shop.ShopId;
         *  var Gladiator = new Gladiator { ShopId = owner, Alive = true, Health = 20, Stamina = 25, Strength = 15, Defense = 0, Speed = 0, Morale = 50, Kills = 0, Loss = 0, Wins = 0 };
         *  DB.Gladiators.Add(Gladiator);
         *  DB.SaveChanges();
         * }*/
        public void LanistaCreate(Lanista lanista)
        {
            Console.WriteLine("\n*LanistaCreate Gladiator*");
            var owner     = lanista.LanistaId;
            var Gladiator = new Gladiator {
                LanistaId = owner,
                Alive     = true,
                Health    = 20, Stamina = 25, Strength = 15, Defense = 0, Speed = 0, Morale = 50,
                Kills     = 0, Loss = 0, Wins = 0
            };

            DB.Gladiators.Add(Gladiator);
            DB.SaveChanges();
        }