Class ActionResult

java.lang.Object
model.battle.ActionResult

public class ActionResult extends Object
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 Details

    • actorName

      private final String actorName
      Name of the entity that performed this action.
    • action

      private final BattleAction action
      The chosen action.
    • damageDealt

      private int damageDealt
      Total raw damage dealt to the target (before defense is applied).
    • healingDone

      private int healingDone
      HP restored during this turn.
    • skillUsed

      private boolean skillUsed
      Whether a skill was used successfully.
    • itemUsed

      private boolean itemUsed
      Whether an item was used successfully.
    • defended

      private boolean defended
      Whether the entity defended this turn.
    • description

      private String description
      Text describing what happened this turn, shown in the UI.
  • Constructor Details

    • ActionResult

      public ActionResult(String actorName, BattleAction action)
      create new ActionResult
      Parameters:
      actorName - ชื่อของ entity ที่ทำ action
      action - The chosen action.
  • Method Details

    • getActorName

      public String getActorName()
      Returns:
      Name of the entity that performed the action
    • getAction

      public BattleAction 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:
      true if a skill was used successfully
    • setSkillUsed

      public void setSkillUsed(boolean s)
      Parameters:
      s - true if a skill was used successfully
    • isItemUsed

      public boolean isItemUsed()
      Returns:
      true if an item was used successfully
    • setItemUsed

      public void setItemUsed(boolean i)
      Parameters:
      i - true if an item was used successfully
    • isDefended

      public boolean isDefended()
      Returns:
      true if the entity defended this turn
    • setDefended

      public void setDefended(boolean d)
      Parameters:
      d - true to indicate the entity defended
    • getDescription

      public String getDescription()
      Returns:
      Description of what happened
    • setDescription

      public void setDescription(String d)
      Parameters:
      d - Description text