Ejemplo n.º 1
0
    public void ReadInputType()
    {
        GlobalVariables.numberOfPlayers = 0;
        GlobalVariables.inputs          = new GlobalVariables.ControlType[4]; //reset all inputs to InputType.Type.Noone

        foreach (Transform child in transform)
        {
            SetupPlayers type = child.GetComponentInChildren <SetupPlayers>();

            if (type)
            {
                GlobalVariables.inputs[GlobalVariables.numberOfPlayers] = type.type;
                GlobalVariables.numberOfPlayers++;
            }
        }
    }
Ejemplo n.º 2
0
        private static void AddNewPlayers()
        {
            for (var newplayerindex = 1; newplayerindex <= rnd.Next(5, 20); newplayerindex++)
            {
                var names    = SetupPlayers.GetNames();
                var forename = names.names[rnd.Next(1, names.names.Count + 1) - 1].forename;
                var surname  = names.names[rnd.Next(1, names.names.Count + 1) - 1].surname;

                var name       = forename + " " + surname;
                var positionId = rnd.Next(1, Enum.GetNames(typeof(PlayerPositionsEnum)).Length + 1);
                var pos        = Enum.GetValues(typeof(PlayerPositionsEnum)).GetValue(positionId - 1);

                var age    = rnd.Next(17, 22);
                var rating = (rnd.Next(1, 100) + rnd.Next(1, 100)) / 2;
                var val    = PlayerData.GetInitialValueFromRating(rating);

                PlayerData.AddNewPlayer(name, 0, rating, (PlayerPositionsEnum)pos, val, age, 0);
            }
        }
Ejemplo n.º 3
0
 public static void Setup()
 {
     SetupPlayers.Setup();
 }