mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +00:00
small refactoring - will use original side and perform no action if asked for other face of a different card (not transform, nor flip) instead of throwing exception
This commit is contained in:
@@ -93,20 +93,16 @@ public enum CPicture implements ICDoc {
|
||||
|
||||
flipped = !flipped;
|
||||
|
||||
final CardCharacteristicName newState;
|
||||
CardCharacteristicName newState = CardCharacteristicName.Original;
|
||||
if (flipped) {
|
||||
if (currentCard.isDoubleFaced()) {
|
||||
newState = CardCharacteristicName.Transformed;
|
||||
} else if (currentCard.isFlipCard()) {
|
||||
newState = CardCharacteristicName.Flipped;
|
||||
} else {
|
||||
throw new RuntimeException("unhandled flippable card");
|
||||
}
|
||||
} else {
|
||||
newState = CardCharacteristicName.Original;
|
||||
}
|
||||
|
||||
CardCharacteristicName oldState = currentCard.getCurState();
|
||||
final CardCharacteristicName oldState = currentCard.getCurState();
|
||||
if (oldState != newState) {
|
||||
currentCard.setState(newState);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user