use of mage.designations.Monarch in project mage by magefree.
the class GameImpl method setMonarchId.
@Override
public void setMonarchId(Ability source, UUID monarchId) {
if (monarchId.equals(getMonarchId())) {
// Nothing happens if you're already the monarch
return;
}
if (replaceEvent(GameEvent.getEvent(GameEvent.EventType.BECOME_MONARCH, monarchId, source, monarchId))) {
return;
}
if (getMonarchId() == null) {
getState().addDesignation(new Monarch(), this, monarchId);
}
Player newMonarch = getPlayer(monarchId);
if (newMonarch != null) {
getState().setMonarchId(monarchId);
informPlayers(newMonarch.getLogName() + " is the monarch");
fireEvent(new GameEvent(GameEvent.EventType.BECOMES_MONARCH, monarchId, source, monarchId));
}
}
Aggregations