Esempio n. 1
0
 public override void Menu()
 {
     Console.Clear();
     Return.Info();
     Return.Roster(p);
     while (day < 11)
     {
         Write.Line(0, 18, "[1] " + Colour.GOLD + "Hire Gladiators\n" + Colour.RESET);
         Write.Line("[2] " + Colour.ENERGY + "Manage Gladiators" + Colour.RESET);
         Write.Line("[3] " + Colour.ITEM + "Purchase Equipment" + Colour.RESET);
         Write.Line("[4] " + Colour.ENERGY + "Jobs" + Colour.RESET);
         Write.Line("[5] " + Colour.ENERGY + "Shady Jobs" + Colour.RESET);
         Write.Line("[6] " + Colour.DEFENCE + "Graveyard" + Colour.RESET);
         Write.Line("[7] " + Colour.XP + "Owner Rankings" + Colour.RESET);
         if (audience)
         {
             Write.Line("[8] " + Colour.XP + "Audience with the emperor" + Colour.RESET);
         }
         else
         {
             Write.Line("[X] " + Colour.MITIGATION + "The emperor has no interest in you" + Colour.RESET);
         }
         Write.Line("[X] " + Colour.MITIGATION + "Not implemented" + Colour.RESET);
         Write.Line("[0] " + Colour.TIME + "Next day" + Colour.RESET);
         Write.Line("[?] Help");
         string choice = Return.Option();
         if (choice == "1")
         {
             Location.list[1].Go();
         }
         else if (choice == "2")
         {
             Location.list[2].Go();
         }
         else if (choice == "3")
         {
             Location.list[3].Go();
         }
         else if (choice == "9")
         {
         }
         else if (choice == "0")
         {
             Arena.Match(ownerList[0].Roster[0], ownerList[1].Roster[0]);
             Arena.Match(ownerList[2].Roster[0], ownerList[3].Roster[0]);
             Arena.Match(ownerList[4].Roster[0], ownerList[5].Roster[0]);
             Arena.Match(ownerList[6].Roster[0], ownerList[7].Roster[0]);
             Arena.Match(ownerList[8].Roster[0], ownerList[9].Roster[0]);
             day++;
             p.Action = 3;
             if (day % 3 == 0)
             {
                 Slaver.NewStock();
             }
             Recap.Go();
         }
         Menu();
     }
 }
Esempio n. 2
0
 private void Recap_selectedchange(object sender, SelectionChangedEventArgs e)
 {
     this.RecapSelected = null;
     if (cbRecap.SelectedItem != null)
     {
         this.RecapSelected = (Recap)cbRecap.SelectedItem;
     }
 }
Esempio n. 3
0
 private void Fight()
 {
     if (player)
     {
         Console.Clear();
         UI();
         Console.SetCursorPosition(0, 22);
         Write.Line("Welcome to the arena!\n");
         Write.Line($"The next match to be fought is between {Gladiator1.Name} and {Gladiator2.Name}!\n");
         Write.KeyPress();
     }
     while (Gladiator1.DeathCheck() == false && Gladiator2.DeathCheck() == false)
     {
         for (int i = 0; i < 4; i++)
         {
             if (player)
             {
                 Console.Clear();
                 UI();
                 Console.SetCursorPosition(0, 22);
             }
             Attack();
             if (Gladiator1.DeathCheck())
             {
                 if (player)
                 {
                     Console.Clear();
                     UI();
                     Console.SetCursorPosition(0, 24);
                     Write.Line($"{Gladiator2.Name} has defeated {Gladiator1.Name}");
                 }
                 Recap.Calculate(Gladiator1, Gladiator2);
                 break;
             }
             if (Gladiator2.DeathCheck())
             {
                 if (player)
                 {
                     Console.Clear();
                     UI();
                     Console.SetCursorPosition(0, 24);
                     Write.Line($"{Gladiator1.Name} has defeated {Gladiator2.Name}");
                 }
                 Recap.Calculate(Gladiator2, Gladiator1);
                 break;
             }
             if (player)
             {
                 Thread.Sleep(1500);
             }
         }
         Fatigue();
         if (player)
         {
             Write.KeyPress();
         }
     }
 }
Esempio n. 4
0
        /// <summary>
        /// Listar a los RecaptFinal del sistema.
        /// </summary>
        /// <param name="n">Parte del nombre de los RecaptFinal a listar</param>
        /// <returns>Lista de los RecaptFinal registrados en el sistema</returns>
        public BindingList <RecaptFinal> listarRecapPreliminarPorEstado(EstadoRecapt estado)
        {
            BindingList <RecaptFinal> recapts = new BindingList <RecaptFinal>();

            SqlCommand    comando    = _manejador.obtenerProcedimiento("SelectRecaptFinalPorAprobar");
            SqlDataReader datareader = null;

            _manejador.agregarParametro(comando, "@estado", estado, SqlDbType.Int);
            Recap recap = new Recap();

            try
            {
                datareader = _manejador.ejecutarConsultaDatos(comando);

                while (datareader.Read())
                {
                    RecaptFinal preliminar = new RecaptFinal();

                    int id_preliminar = (int)datareader["pk_ID"];
                    int tipo          = (int)datareader["Tipo"];


                    Colaborador colaborador = null;

                    if (datareader["ID_Colaborador"] != DBNull.Value)
                    {
                        int    id_cliente       = (int)datareader["ID_Colaborador"];
                        string nombre           = (string)datareader["Nombre"];
                        string primer_apellido  = (string)datareader["Primer_Apellido"];
                        string segundo_apellido = (string)datareader["Segundo_Apellido"];

                        colaborador = new Colaborador(id: id_cliente, nombre: nombre, primer_apellido: primer_apellido, segundo_apellido: segundo_apellido);
                    }



                    DateTime fecha = (DateTime)datareader["Fecha_Ingreso"];
                    preliminar.TipoRecap     = (TipoRecapt)tipo;
                    preliminar.ID            = id_preliminar;
                    preliminar.Colaborador   = colaborador;
                    preliminar.Fecha_ingreso = fecha;

                    recapts.Add(preliminar);
                }

                comando.Connection.Close();
            }
            catch (Exception)
            {
                comando.Connection.Close();
                throw new Excepcion("ErrorDatosConexion");
            }

            return(recapts);
        }
Esempio n. 5
0
        /// <summary>
        /// Listar a los RecaptFinal del sistema.
        /// </summary>
        /// <param name="n">Parte del nombre de los RecaptFinal a listar</param>
        /// <returns>Lista de los RecaptFinal registrados en el sistema</returns>
        public BindingList <Recap> listarRecap(DateTime n)
        {
            BindingList <Recap> recapts = new BindingList <Recap>();

            SqlCommand    comando    = _manejador.obtenerProcedimiento("SelectRecaps");
            SqlDataReader datareader = null;

            comando.CommandTimeout = 100000;
            _manejador.agregarParametro(comando, "@fecha", n, SqlDbType.Date);

            Recap recap = new Recap();

            try
            {
                datareader = _manejador.ejecutarConsultaDatos(comando);

                while (datareader.Read())
                {
                    RecaptFinal preliminar = new RecaptFinal();

                    int         id_preliminar = (int)datareader["pk_ID"];
                    TipoRecapt  tipo          = (TipoRecapt)datareader["Tipo"];
                    Colaborador colaborador   = null;

                    if (datareader["ID_Colaborador"] != DBNull.Value)
                    {
                        short  id_cliente       = (short)datareader["ID_Colaborador"];
                        string nombre           = (string)datareader["Nombre"];
                        string primer_apellido  = (string)datareader["Primer_Apellido"];
                        string segundo_apellido = (string)datareader["Segundo_Apellido"];

                        colaborador = new Colaborador(id: id_cliente, nombre: nombre, primer_apellido: primer_apellido, segundo_apellido: segundo_apellido);
                    }

                    preliminar.TipoRecap = tipo;

                    DateTime fecha = (DateTime)datareader["Fecha_Ingreso"];

                    preliminar.Colaborador = colaborador;

                    recap.agregarRecapFinal(preliminar);
                }

                comando.Connection.Close();
            }
            catch (Exception)
            {
                comando.Connection.Close();
                throw new Excepcion("ErrorDatosConexion");
            }

            return(recapts);
        }
Esempio n. 6
0
        public async Task <IActionResult> Create(Recap recap)
        {
            if (ModelState.IsValid)
            {
                _db.Recap.Add(recap);
                await _db.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }

            return(View(recap));
        }
Esempio n. 7
0
        public async Task <IActionResult> Edit(int id, Recap recap)
        {
            if (id != recap.Id)
            {
                return(NotFound());
            }
            if (ModelState.IsValid)
            {
                _db.Recap.Update(recap);
                await _db.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }

            return(View(recap));
        }
Esempio n. 8
0
 public void Recap(string user, Recap recap)
 {
     ErrorsHub.Recap(user, recap);
 }
Esempio n. 9
0
 public static void Recap(string user, Recap recap)
 {
     GlobalHost.ConnectionManager.GetHubContext <ErrorsHub>().Clients.User(user).recap(recap);
 }