private static class ChangeSet.AttackChange extends ChangeSet.Change
| Modifier and Type | Field and Description |
|---|---|
private Unit |
attacker |
private Unit |
defender |
private boolean |
defenderInSettlement |
private boolean |
success |
see| Constructor and Description |
|---|
AttackChange(ChangeSet.See see,
Unit attacker,
Unit defender,
boolean success)
Build a new AttackChange.
|
| Modifier and Type | Method and Description |
|---|---|
void |
attachToElement(org.w3c.dom.Element element)
Some changes can not be directly specialized, but need to be
directly attached to an element.
|
int |
getPriority()
Gets the sort priority.
|
boolean |
isPerhapsNotifiable(ServerPlayer serverPlayer)
Should a player perhaps be notified of this attack? Do not
use canSeeUnit because that gives a false negative for
units in settlements, which should be animated.
|
org.w3c.dom.Element |
toElement(ServerPlayer serverPlayer,
org.w3c.dom.Document doc)
Specialize a AttackChange into an "animateAttack" element
for a particular player.
|
java.lang.String |
toString() |
consequences, convertsToElement, isNotifiable, matchesprivate final Unit attacker
private final Unit defender
private final boolean success
private final boolean defenderInSettlement
public AttackChange(ChangeSet.See see, Unit attacker, Unit defender, boolean success)
see - The visibility of this change.attacker - The Unit that is attacking.defender - The Unit that is defending.success - Did the attack succeed.public int getPriority()
getPriority in class ChangeSet.Changepublic boolean isPerhapsNotifiable(ServerPlayer serverPlayer)
isPerhapsNotifiable in class ChangeSet.ChangeserverPlayer - The ServerPlayer to notify.public org.w3c.dom.Element toElement(ServerPlayer serverPlayer, org.w3c.dom.Document doc)
toElement in class ChangeSet.ChangeserverPlayer - The ServerPlayer to update.doc - The owner Document.public void attachToElement(org.w3c.dom.Element element)
attachToElement in class ChangeSet.Changeelement - The Element to attach to.public java.lang.String toString()
toString in class java.lang.Object