Package cs2110

Interface Actor

All Known Implementing Classes:
Monster, Player

public interface Actor
An individual who takes turns during the game simulation.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    attack(Actor target)
    Launches an attack against the given `target`.
    boolean
    defend(int atk)
    Responds to an attack with the given `atk` roll.
    int
    Returns the current health level for this Actor.
    Returns the name of this Actor.
    int
    Returns the base power level for this Actor.
    void
    Simulates the actions that take place during one turn for this Actor.
  • Method Details

    • takeTurn

      void takeTurn()
      Simulates the actions that take place during one turn for this Actor.
    • attack

      void attack(Actor target)
      Launches an attack against the given `target`.
    • defend

      boolean defend(int atk)
      Responds to an attack with the given `atk` roll. Returns `true` if the defense succeeded, false otherwise.
    • name

      String name()
      Returns the name of this Actor.
    • health

      int health()
      Returns the current health level for this Actor.
    • power

      int power()
      Returns the base power level for this Actor.