Exemplo n.º 1
0
 /// <summary>
 /// Sets the built damage action to use percentage-of-last-received-move damage.
 /// </summary>
 /// <param name="builder">The damage action builder.</param>
 /// <param name="percentage">The percentage of damage to deal.</param>
 /// <param name="actionHistory">The action history.</param>
 public static DamageActionBuilder PercentageOfLastReceivedMoveDamage(
     this DamageActionBuilder builder,
     int percentage,
     IActionHistory actionHistory)
 {
     return(builder.WithDamageCalculator(new PercentageOfLastReceivedMoveDamageCalculator(percentage, actionHistory)));
 }
Exemplo n.º 2
0
        public void WithDamageCalculator_NullArgument_Throws()
        {
            // Arrange
            var builder = new DamageActionBuilder();

            // Act and Assert
            Assert.Throws <ArgumentNullException>(() => _ = builder.WithDamageCalculator(null));
        }
Exemplo n.º 3
0
 /// <summary>
 /// Sets the built damage action to use percentage-of-last-received-move damage.
 /// </summary>
 /// <param name="builder">The damage action builder.</param>
 /// <param name="startingBasePower">The starting base power.</param>
 /// <param name="linearFactor">The linear factor.</param>
 /// <param name="random">The random number generator.</param>
 /// <param name="actionHistory">The action history.</param>
 public static DamageActionBuilder BasePowerIncreasesLinearlyWithUses(
     this DamageActionBuilder builder,
     int startingBasePower,
     int linearFactor,
     IRandom random,
     IActionHistory actionHistory)
 {
     return(builder.WithDamageCalculator(new BasePowerIncreasesLinearlyWithUsesDamageCalculator(startingBasePower, linearFactor, random, actionHistory)));
 }