Ejemplo n.º 1
0
        public Core()
        {
            Random randy = new Random();
            #region abrir nombres.txt
            using (StreamReader r = new StreamReader("..\\..\\..\\nombres.txt"))
            {
                string line;
                while ((line = r.ReadLine()) != null)
                {
                    nombres.Add(line);
                }
            }
            #endregion
            #region crear worms
            for (int i = 0; i < 10; i++)
            {
                bando equipo = bando.azul;
                if (i > 4)
                {
                    equipo = bando.rojo;
                }
                var index = randy.Next(0, nombres.Count() - 1);
                var nombre = nombres[index];
                nombres.RemoveAt(index);

                worms[i] = new Worm(randy, nombre, equipo, m.SuperficiesPisables());
                m.Add(worms[i].posicion, "2");

            }
            #endregion
        }
Ejemplo n.º 2
0
 public UCWorm(Worm _w)
 {
     InitializeComponent();
     this.w = _w;
     nombre.Content = _w.nombre;
     nombre.Foreground = (_w.equipo == Bandos.bando.rojo) ? new SolidColorBrush(Colors.Red) : new SolidColorBrush(Colors.Blue);
     nombre.FontSize = 14;
     hp.Content = _w.hp;
     hp.Foreground = (_w.equipo == Bandos.bando.rojo) ? new SolidColorBrush(Colors.Red) : new SolidColorBrush(Colors.Blue);
     hp.FontSize = 14;
 }