changed to UNIX line endings

master
melvin 2013-02-16 17:15:13 +08:00
parent 861c0ec58b
commit 65b8ba5107
1 changed files with 41 additions and 44 deletions

View File

@ -1,45 +1,42 @@
package magic.model.action;
import magic.model.MagicGame;
import magic.model.MagicPlayer;
import magic.model.MagicPlayerState;
public class MagicChangePlayerStateAction extends MagicAction {
private final MagicPlayer player;
private final MagicPlayerState state;
private final boolean set;
private boolean changed;
public MagicChangePlayerStateAction(final MagicPlayer player,final MagicPlayerState state,final boolean set) {
this.player=player;
this.state=state;
this.set=set;
}
@Override
public void doAction(final MagicGame game) {
changed=player.hasState(state)!=set;
if (changed) {
if (set) {
player.setState(state);
} else {
player.clearState(state);
}
}
}
@Override
public void undoAction(final MagicGame game) {
if (changed) {
if (set) {
player.clearState(state);
} else {
player.setState(state);
}
}
}
package magic.model.action;
import magic.model.MagicGame;
import magic.model.MagicPlayer;
import magic.model.MagicPlayerState;
public class MagicChangePlayerStateAction extends MagicAction {
private final MagicPlayer player;
private final MagicPlayerState state;
private final boolean set;
private boolean changed;
public MagicChangePlayerStateAction(final MagicPlayer player,final MagicPlayerState state,final boolean set) {
this.player=player;
this.state=state;
this.set=set;
}
@Override
public void doAction(final MagicGame game) {
changed=player.hasState(state)!=set;
if (changed) {
if (set) {
player.setState(state);
} else {
player.clearState(state);
}
}
}
@Override
public void undoAction(final MagicGame game) {
if (changed) {
if (set) {
player.clearState(state);
} else {
player.setState(state);
}
}
}
}