forked from External/mage
Dev: added additional info to some classes for easy debug;
This commit is contained in:
parent
bde6222ea6
commit
0e916b6e29
19 changed files with 133 additions and 19 deletions
|
|
@ -1,6 +1,7 @@
|
|||
package mage.view;
|
||||
|
||||
import mage.game.Game;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
|
@ -43,27 +44,12 @@ public class ChatMessage implements Serializable {
|
|||
this.username = username;
|
||||
this.message = message;
|
||||
this.time = time;
|
||||
this.turnInfo = prepareTurnInfo(game);
|
||||
this.turnInfo = CardUtil.getTurnInfo(game);
|
||||
this.color = color;
|
||||
this.messageType = messageType;
|
||||
this.soundToPlay = soundToPlay;
|
||||
}
|
||||
|
||||
private String prepareTurnInfo(Game game) {
|
||||
// no turn info
|
||||
if (game == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// not started game
|
||||
if (game.getStep() == null) {
|
||||
return "T0";
|
||||
}
|
||||
|
||||
// normal game
|
||||
return "T" + game.getTurnNum() + "." + game.getStep().getType().getStepShortText();
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue