Skip to content

Commit 58cd913

Browse files
committed
Remove unnecessary parens; improve assert message
1 parent 94cc26f commit 58cd913

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

cardshifter-core/src/main/java/com/cardshifter/core/groovy/EffectDelegate.groovy

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ class EffectDelegate {
121121
}
122122

123123
def doNothing() {
124-
descriptionList << ("do nothing")
124+
descriptionList << "do nothing"
125125
closures.add({Entity source, Object data -> })
126126
}
127127

@@ -149,7 +149,7 @@ class EffectDelegate {
149149
def drawCard(String who, int count) {
150150
def s = count == 1 ? '' : 's'
151151
if (who == 'all') {
152-
descriptionList << ("all players draw $count card$s")
152+
descriptionList << "all players draw $count card$s"
153153
closures.add({Entity source, Object data ->
154154
Players.getPlayersInGame(source.game).forEach({Entity e ->
155155
for (int i = 0; i < count; i++) {
@@ -159,7 +159,7 @@ class EffectDelegate {
159159
})
160160
return;
161161
}
162-
descriptionList << ("$who draws $count card$s")
162+
descriptionList << "$who draws $count card$s"
163163
closures.add({Entity source, Object data ->
164164
Entity drawer = entityLookup(source, who)
165165
for (int i = 0; i < count; i++) {
@@ -270,7 +270,7 @@ class EffectDelegate {
270270
})
271271
}
272272
}
273-
assert closure : "Unknown target $who"
273+
assert closure : "Effect must have a valid target, not '$who'. Description list: $descriptionList"
274274

275275
descriptionList << desc.replace('%who%', targetStr)
276276
closures.add(closure)

0 commit comments

Comments
 (0)