Пример #1
0
        private void IA_Attack()
        {
            lblAsignamiento.Text = "Ataque";
            //Calculate posibilities attacks
            playerIA.PredictAllAttacks(Tablero.IA);

            //Execute the best's attacks
            playerIA.Attack(Tablero.IA);

            var aux = playerIA.Attacks.Count();

            for (int i = 0; i < aux; i++)
            {
                /* Debo retornar un string de los 2 paises que se ven afectados
                 * en el ataque de la forma: [2;5] */
                string countries = playerIA.Attacks.Dequeue();

                int aux1 = int.Parse(countries.Split(';')[0]);
                RefreshCountries(Tablero.Lista_Paises[aux1 - 1].Id_Pais, Tablero.Lista_Paises[aux1 - 1].Pertenencia, Tablero.Lista_Paises[aux1 - 1].Tropas);

                //Tiempo de retardo entre cambios

                int aux2 = int.Parse(countries.Split(';')[1]);
                RefreshCountries(Tablero.Lista_Paises[aux2 - 1].Id_Pais, Tablero.Lista_Paises[aux2 - 1].Pertenencia, Tablero.Lista_Paises[aux2 - 1].Tropas);

                //Tiempo de retardo entre cambios
            }
        }
Пример #2
0
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();

        IA attachedIA = (IA)target;

        if (GUILayout.Button("Attack"))
        {
            attachedIA.Attack();
        }

        if (GUILayout.Button("Defend"))
        {
            attachedIA.Defend();
        }
    }
Пример #3
0
 public void AttackAnima()
 {
     intel.Attack();
 }