Package cs2110
Interface Actor
public interface Actor
An individual who takes turns during the game simulation.
-
Method Summary
Modifier and TypeMethodDescriptionvoidLaunches an attack against the given `target`.booleandefend(int atk) Responds to an attack with the given `atk` roll.inthealth()Returns the current health level for this Actor.name()Returns the name of this Actor.intpower()Returns the base power level for this Actor.voidtakeTurn()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
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.
-