@Test public void testGetDamage() { final int damage = weapon1.getDamage(); assertTrue(damage >= MIN_HIT); assertTrue(damage <= MAX_HIT); assertEquals(MAX_HIT, weapon2.getDamage()); }
public int getDamage() { int minModifier = ((WeaponProperties) properties).getMinHit(); int maxModifier = ((WeaponProperties) properties).getMaxHit(); return (int) (Math.random() * (maxModifier - minModifier + 1)) + minModifier; }
Weapon extends AbstractEquipableItem { public int getDamage() { int minModifier = ((WeaponProperties) properties).getMinHit(); int maxModifier = ((WeaponProperties) properties).getMaxHit(); return (int) (Math.random() * (maxModifier - minModifier + 1)) + minModifier; } }
Weapon extends AbstractEquipableItem { public int getDamage() { int minModifier = ((WeaponProperties) properties).getMinHit(); int maxModifier = ((WeaponProperties) properties).getMaxHit(); return (int) (Math.random() * (maxModifier - minModifier + 1)) + minModifier; } Weapon(WeaponProperties properties, int amount); }
Weapon extends AbstractEquipableItem { public int getDamage() { int minModifier = ((WeaponProperties) properties).getMinHit(); int maxModifier = ((WeaponProperties) properties).getMaxHit(); return (int) (Math.random() * (maxModifier - minModifier + 1)) + minModifier; } Weapon(WeaponProperties properties, int amount); @Override Item clone(); @Override void use(Character character); boolean getStabs(); int getPiercingDamage(); int getMinHit(); int getMaxHit(); int getDamage(); }
Weapon extends AbstractEquipableItem { public int getDamage() { int minModifier = ((WeaponProperties) properties).getMinHit(); int maxModifier = ((WeaponProperties) properties).getMaxHit(); return (int) (Math.random() * (maxModifier - minModifier + 1)) + minModifier; } Weapon(WeaponProperties properties, int amount); @Override Item clone(); @Override void use(Character character); boolean getStabs(); int getPiercingDamage(); int getMinHit(); int getMaxHit(); int getDamage();  }