public DragonDto CreateDragon(DragonDto dragon, KnightDto knight)
        {
            var abilitiesOrderedList = DetermineStrongestKnightAbility(knight);

            var dragonAbilities = DefineDragonAbilities(abilitiesOrderedList);

            dragon = dragonAbilities;

            return(dragon);
        }
 public NormalWeatherStrategyTests()
 {
     _normalStrategy = new NormalWeatherStrategy();
     _dragon         = new DragonDto();
     _knight         = new KnightDto
     {
         Agility   = 8,
         Armor     = 4,
         Attack    = 0,
         Endurance = 8
     };
 }
        public DragonDto CreateDragon(DragonDto dragon, KnightDto knight)
        {
            dragon = new DragonDto
            {
                ClawSharpness  = 5,
                FireBreath     = 5,
                ScaleThickness = 5,
                WingStrength   = 5
            };

            return(dragon);
        }
Exemple #4
0
        public DragonDto CreateDragon(DragonDto dragon, KnightDto knight)
        {
            var fire = dragon.FireBreath;

            dragon.ClawSharpness = dragon.ClawSharpness + fire;

            if (dragon.ClawSharpness > 10)
            {
                var attributes = dragon.ClawSharpness - 10;
                dragon.ScaleThickness = dragon.ScaleThickness + attributes;
                dragon.ClawSharpness  = 10;
            }
            dragon.FireBreath = 0;

            return(dragon);
        }
        private List <KeyValuePair <KnightsAttributes, int> > DetermineStrongestKnightAbility(KnightDto knight)
        {
            var test = new Dictionary <KnightsAttributes, int>
            {
                { KnightsAttributes.Agility, knight.Agility },
                { KnightsAttributes.Armor, knight.Armor },
                { KnightsAttributes.Attack, knight.Attack },
                { KnightsAttributes.Endurance, knight.Endurance }
            };

            return(test.OrderByDescending(x => x.Value).ToList());
        }
Exemple #6
0
 public DragonDto CreateDragon(DragonDto dragon, KnightDto knight)
 {
     return(dragon);
 }
Exemple #7
0
        public static DragonDto CreateDragon(string code, DragonDto dragon, KnightDto knight)
        {
            var result = _strategies[code].CreateDragon(dragon, knight);

            return(result);
        }