Пример #1
0
 protected internal override void SetPersonAttributes(int totalRating, Player player)
 {
     player.PersonAttributes = new Dictionary <string, int>();
     player.PersonAttributes.AddRange(PlayerAttributeGenerator.AddPlayerAttributesByPlayerType(typeof(AttributeName.GoalyAttributes), totalRating, player.MainFunction == Position.Goaly));
     player.PersonAttributes.AddRange(PlayerAttributeGenerator.AddPlayerAttributesByPlayerType(typeof(AttributeName.FysicalAttributes), totalRating, RandomUtil.GetRandomBoolWithPossiblityToImproveChances(RandomUtil.GetRandomInt(1, 6))));
     player.PersonAttributes.AddRange(PlayerAttributeGenerator.AddPlayerAttributesByPlayerType(typeof(AttributeName.MentalAttributes), totalRating, RandomUtil.GetRandomBoolWithPossiblityToImproveChances(RandomUtil.GetRandomInt(1, 6))));
     player.PersonAttributes.AddRange(PlayerAttributeGenerator.AddPlayerAttributesByPlayerType(typeof(AttributeName.SetPiecesAttributes), totalRating, RandomUtil.GetRandomBoolWithPossiblityToImproveChances(RandomUtil.GetRandomInt(1, 6))));
     player.PersonAttributes.AddRange(PlayerAttributeGenerator.AddPlayerAttributesByPlayerType(typeof(AttributeName.AttackingAttributes), totalRating, (RandomUtil.GetRandomBoolWithPossiblityToImproveChances(player.MainFunction) && player.MainFunction != Position.Goaly)));
     player.PersonAttributes.AddRange(PlayerAttributeGenerator.AddPlayerAttributesByPlayerType(typeof(AttributeName.DefensiveAttributes), totalRating, player.MainFunction == Position.Defence));
     player.PersonAttributes.AddRange(PlayerAttributeGenerator.AddPlayerAttributesByPlayerType(typeof(AttributeName.MidfieldAttribues), totalRating, player.MainFunction == Position.Midfield));
     player.PersonAttributes.AddRange(PlayerAttributeGenerator.AddPlayerAttributesByPlayerType(typeof(AttributeName.ForwardAttributes), totalRating, player.MainFunction == Position.Forward));
 }
        public void AddPlayerAttributesByPlayerType_ReturnsPlayerAttributesForGivenType(Type attributeType)
        {
            var attributes = PlayerAttributeGenerator.AddPlayerAttributesByPlayerType(attributeType, _random.Next(1, 5), true);

            AssertAttributesByType(attributes, attributeType);
        }