Exemplo n.º 1
0
        protected virtual void SkilledBombardierTemplate(List <ManeuverTemplate> availableTemplates, GenericUpgrade upgrade)
        {
            List <ManeuverTemplate> AddedTemplates = new List <ManeuverTemplate>();

            foreach (ManeuverTemplate availableTemplate in availableTemplates)
            {
                ManeuverSpeed    reducedSpeed         = availableTemplate.Speed - 1;
                ManeuverTemplate reducedSpeedTemplate = new ManeuverTemplate(availableTemplate.Bearing, availableTemplate.Direction, reducedSpeed, isBombTemplate: true);
                if (reducedSpeedTemplate.IsValidTemplate() &&
                    !availableTemplates.Any(t => t.Name == reducedSpeedTemplate.Name) &&
                    !AddedTemplates.Any(t => t.Name == reducedSpeedTemplate.Name)
                    )
                {
                    AddedTemplates.Add(reducedSpeedTemplate);
                }

                ManeuverSpeed    increasedSpeed         = availableTemplate.Speed + 1;
                ManeuverTemplate increasedSpeedTemplate = new ManeuverTemplate(availableTemplate.Bearing, availableTemplate.Direction, increasedSpeed, isBombTemplate: true);
                if (increasedSpeedTemplate.IsValidTemplate() &&
                    !availableTemplates.Any(t => t.Name == increasedSpeedTemplate.Name) &&
                    !AddedTemplates.Any(t => t.Name == increasedSpeedTemplate.Name)
                    )
                {
                    AddedTemplates.Add(increasedSpeedTemplate);
                }
            }

            availableTemplates.AddRange(AddedTemplates);
        }