replaced StringBuffer with StringBuilder

master
melvin 2011-09-03 15:16:27 +08:00
parent 9b4cc36e75
commit c5bb97d98b
1 changed files with 8 additions and 6 deletions

View File

@ -11,20 +11,22 @@ public class MagicRemoveCounterEvent extends MagicEvent {
@Override
public void executeEvent(final MagicGame game,final MagicEvent event,final Object[] data,final Object[] choices) {
final int amount=(Integer)data[2];
game.doAction(new MagicChangeCountersAction((MagicPermanent)data[0],(MagicCounterType)data[1],-amount,true));
}
};
public MagicRemoveCounterEvent(final MagicPermanent permanent,final MagicCounterType counterType,final int amount) {
super(permanent,permanent.getController(),new Object[]{permanent,counterType,amount},EVENT_ACTION,getDescription(permanent,counterType,amount));
super(
permanent,
permanent.getController(),
new Object[]{permanent,counterType,amount},
EVENT_ACTION,
getDescription(permanent,counterType,amount));
}
private static String getDescription(final MagicPermanent permanent,final MagicCounterType counterType,final int amount) {
final StringBuffer description=new StringBuffer("Remove ");
final StringBuilder description=new StringBuilder("Remove ");
if (amount==1) {
description.append("a ").append(counterType.getName()).append(" counter");
} else {
@ -33,4 +35,4 @@ public class MagicRemoveCounterEvent extends MagicEvent {
description.append(" from ").append(permanent.getName()).append('.');
return description.toString();
}
}
}