abstract class Effect implements Sheetable { protected int theDuration; protected Affectable theVictim; Effect(int duration, Affectable vict) { theDuration = duration; theVictim = vict; } void update() { --theDuration; } boolean hasExpired() { return theDuration <= 0; } void apply(boolean quiet) { theVictim.insertEffect(this); } void undo(boolean quiet) { theVictim.removeEffect(this); } public String getSheet() { return theDuration + " hora(s)"; } }