Пример #1
0
        private void Streamer_v(object sender, RoutedEventArgs e)
        {
            if (!File.Exists("Resurse/streamer_list.txt"))
            {
                File.CreateText("Resurse/streamer_list.txt").Close();
            }
            var lines = File.ReadLines("Resurse/streamer_list.txt");
            int a     = 0;

            foreach (var line in lines)
            {
                if (a == 0)
                {
                    Cutie.AppendText(line);
                    a = 2;
                }
                else
                {
                    Cutie.AppendText("\r" + line);
                }
            }
        }
Пример #2
0
    public void UnitSpawner()    //
    {
        for (int j = 0; j < units.Length; j++)
        {
            int UnitType;
            int factionAllocte;

            int    x       = rand.Next(1, 20);
            int    y       = rand.Next(1, 20);
            string faction = "";
            string symbol  = "";
            UnitType = rand.Next(1, 5);

            switch (UnitType)
            {
            case 1:         //Melee baby sharks
                factionAllocte = rand.Next(1, 3);
                switch (factionAllocte)
                {
                case 1:             //hammerHead sharks
                    faction = "Hammerhead";
                    symbol  = "H";
                    break;

                case 2:             //raggertooth sharks
                    faction = "Raggertooth";
                    symbol  = "R";
                    break;
                }
                units[j] = new MeleeUnit(x, y, faction, symbol);
                break;

            case 2:         //Ranged baby sharks
                factionAllocte = rand.Next(1, 3);
                switch (factionAllocte)
                {
                case 1:
                    faction = "Hammerhead";
                    symbol  = "h";
                    break;

                case 2:
                    faction = "Raggertooth";
                    symbol  = "r";
                    break;
                }
                units[j] = new RangeUnit(x, y, faction, symbol);
                break;

            case 3:         //cutie baby sharks0
                factionAllocte = rand.Next(1, 3);
                switch (factionAllocte)
                {
                case 1:             //hammerHead sharks
                    faction = "Hammerhead";
                    symbol  = "C";
                    break;

                case 2:             //raggertooth sharks
                    faction = "Raggertooth";
                    symbol  = "c";
                    break;
                }
                units[j] = new Cutie(x, y, faction, symbol);
                break;

            case 4:         //agro baby sharks
                factionAllocte = rand.Next(1, 3);
                switch (factionAllocte)
                {
                case 1:             //hammerHead sharks
                    faction = "Hammerhead";
                    symbol  = "A";
                    break;

                case 2:             //raggertooth sharks
                    faction = "Raggertooth";
                    symbol  = "a";
                    break;
                }
                units[j] = new AgroSharks(x, y, faction, symbol);
                break;
            }
            //GameMap[units[j].YPos, units[j].XPos] = units[j].Symbol;
        }
    }