Class ActionResult
java.lang.Object
model.battle.ActionResult
Stores the result of one entity's action in a single turn.
A BattleResult contains two ActionResults — one for entityA and one for entityB.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BattleActionThe chosen action.private final StringName of the entity that performed this action.private intTotal raw damage dealt to the target (before defense is applied).private booleanWhether the entity defended this turn.private StringText describing what happened this turn, shown in the UI.private intHP restored during this turn.private booleanWhether an item was used successfully.private booleanWhether a skill was used successfully. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintintbooleanbooleanbooleanvoidsetDamageDealt(int d) voidsetDefended(boolean d) voidvoidsetHealingDone(int h) voidsetItemUsed(boolean i) voidsetSkillUsed(boolean s)
-
Field Details
-
actorName
Name of the entity that performed this action. -
action
The chosen action. -
damageDealt
private int damageDealtTotal raw damage dealt to the target (before defense is applied). -
healingDone
private int healingDoneHP restored during this turn. -
skillUsed
private boolean skillUsedWhether a skill was used successfully. -
itemUsed
private boolean itemUsedWhether an item was used successfully. -
defended
private boolean defendedWhether the entity defended this turn. -
description
Text describing what happened this turn, shown in the UI.
-
-
Constructor Details
-
ActionResult
create new ActionResult- Parameters:
actorName- ชื่อของ entity ที่ทำ actionaction- The chosen action.
-
-
Method Details
-
getActorName
- Returns:
- Name of the entity that performed the action
-
getAction
- Returns:
- The chosen action.
-
getDamageDealt
public int getDamageDealt()- Returns:
- Damage dealt
-
setDamageDealt
public void setDamageDealt(int d) - Parameters:
d- Damage dealt
-
getHealingDone
public int getHealingDone()- Returns:
- HP restored
-
setHealingDone
public void setHealingDone(int h) - Parameters:
h- HP restored
-
isSkillUsed
public boolean isSkillUsed()- Returns:
trueif a skill was used successfully
-
setSkillUsed
public void setSkillUsed(boolean s) - Parameters:
s-trueif a skill was used successfully
-
isItemUsed
public boolean isItemUsed()- Returns:
trueif an item was used successfully
-
setItemUsed
public void setItemUsed(boolean i) - Parameters:
i-trueif an item was used successfully
-
isDefended
public boolean isDefended()- Returns:
trueif the entity defended this turn
-
setDefended
public void setDefended(boolean d) - Parameters:
d-trueto indicate the entity defended
-
getDescription
- Returns:
- Description of what happened
-
setDescription
- Parameters:
d- Description text
-