@Test public void testAppliesToCharacterCharacter() { final Character deadTarget = mock(Character.class); when(deadTarget.isDead()).thenReturn(Boolean.TRUE); final Character aliveTarget = mock(Character.class); final Character caster = mock(Character.class); assertTrue(hpEffect1.appliesTo(caster, aliveTarget)); assertTrue(hpEffect2.appliesTo(caster, aliveTarget)); assertFalse(hpEffect1.appliesTo(caster, deadTarget)); assertFalse(hpEffect2.appliesTo(caster, deadTarget)); }
@Override public boolean appliesTo(Character caster, Character target) { if (target.isDead()) { return false; } return true; }
HitPointsEffect implements Effect { @Override public boolean appliesTo(Character caster, Character target) { if (target.isDead()) { return false; } return true; } }
HitPointsEffect implements Effect { @Override public boolean appliesTo(Character caster, Character target) { if (target.isDead()) { return false; } return true; } HitPointsEffect(int minPoints, int maxPoints); }
HitPointsEffect implements Effect { @Override public boolean appliesTo(Character caster, Character target) { if (target.isDead()) { return false; } return true; } HitPointsEffect(int minPoints, int maxPoints); @Override void apply(Character caster, Character target); @Override boolean appliesTo(Character caster, Character target); @Override boolean appliesTo(Character caster, WorldObject worldobject); @Override void apply(Character caster, WorldObject target); }
HitPointsEffect implements Effect { @Override public boolean appliesTo(Character caster, Character target) { if (target.isDead()) { return false; } return true; } HitPointsEffect(int minPoints, int maxPoints); @Override void apply(Character caster, Character target); @Override boolean appliesTo(Character caster, Character target); @Override boolean appliesTo(Character caster, WorldObject worldobject); @Override void apply(Character caster, WorldObject target);  }