HandsOff/TeamCreatorPage.xaml.cs
/// <summary>
/// Creates new random team with random properties.
/// </summary>
/// <returns></returns>
Creates new random team with random properties.
Creates new random team with random properties .
public Team CreateTeam()
        {
            System.Random randomSkill = new System.Random();
            Team team = new Team();
            int Attack;
            int Speed;
            int Defence;
            for (int i = 1; i < 12; i++)
            {
                switch (i)
                {
                    case 1:
                        Attack = randomSkill.Next(1, 101);
                        Speed = randomSkill.Next(1, 101);
                        Defence = randomSkill.Next(1, 101);
                        break;
                    case 2:
                    case 3:
                    case 4:
                    case 5:
                        Attack = randomSkill.Next(1, 101);
                        Speed = randomSkill.Next(1, 101);
                        Defence = randomSkill.Next(1, 101);
                        break;
                    case 6:
                    case 7:
                    case 8:
                        Attack = randomSkill.Next(1, 101);
                        Speed = randomSkill.Next(1, 101);
                        Defence = randomSkill.Next(1, 101);
                        break;
                    case 9:
                    case 10:
                    case 11:
                    default:
                        Attack = randomSkill.Next(1, 101);
                        Speed = randomSkill.Next(1, 101);
                        Defence = randomSkill.Next(1, 101);
                        break;
                }
                Player player = new Player(i, Attack, Speed, Defence);
                team.AddPlayerToTeam(player);
            }
            return team;
        }
public Team CreateTeam ( ) { System . Random randomSkill = new System . Random ( ) ; Team team = new Team ( ) ; int Attack ; int Speed ; int Defence ; for ( int i = 1 ; i < 12 ; i ++ ) { switch ( i ) { case 1 : Attack = randomSkill . Next ( 1 , 101 ) ; Speed = randomSkill . Next ( 1 , 101 ) ; Defence = randomSkill . Next ( 1 , 101 ) ; break ; case 2 : case 3 : case 4 : case 5 : Attack = randomSkill . Next ( 1 , 101 ) ; Speed = randomSkill . Next ( 1 , 101 ) ; Defence = randomSkill . Next ( 1 , 101 ) ; break ; case 6 : case 7 : case 8 : Attack = randomSkill . Next ( 1 , 101 ) ; Speed = randomSkill . Next ( 1 , 101 ) ; Defence = randomSkill . Next ( 1 , 101 ) ; break ; case 9 : case 10 : case 11 : default : Attack = randomSkill . Next ( 1 , 101 ) ; Speed = randomSkill . Next ( 1 , 101 ) ; Defence = randomSkill . Next ( 1 , 101 ) ; break ; } Player player = new Player ( i , Attack , Speed , Defence ) ; team . AddPlayerToTeam ( player ) ; } return team ; }
Creates new random team with random properties.
Creates new random team with random properties .
None