Class FightManager
java.lang.Object
FightManager
Manages one RPG fight (one encounter).
- Since:
- 2016-02-10
-
Field Summary
Modifier and TypeFieldDescriptionParties ordered by initiative.private static final int
Maximum number of turns allowed in a fight.private Party
First party in this fight.private Party
Second party in this fight.private static boolean
Report play-by-play action for fights.private int
Count turns/rounds in current fight.private Party
Winner of this fight. -
Constructor Summary
ConstructorDescriptionFightManager
(Monster mon1, Monster mon2) Constructor for solo monstersFightManager
(Party party1, Party party2) Constructor for parties -
Method Summary
Modifier and TypeMethodDescriptionprivate void
Decide on the winner of a fight.fight()
Fight a duel between parties.static boolean
Get play-by-play reporting.int
Get current turn count.Get the winner.private void
Handle membership changes for both sides (e.g., new creatures conjured or dispelled)private void
Report play-by-play status.private void
Set the initiative order.static void
setPlayByPlayReporting
(boolean report) Set play-by-play reporting.toString()
Identify this object as a string.boolean
Check if winner was first-mover?
-
Field Details
-
MAX_TURNS
private static final int MAX_TURNSMaximum number of turns allowed in a fight.- See Also:
-
reportPlayByPlay
private static boolean reportPlayByPlayReport play-by-play action for fights. -
turnCount
private int turnCountCount turns/rounds in current fight. -
party1
First party in this fight. -
party2
Second party in this fight. -
initOrder
Parties ordered by initiative. -
winner
Winner of this fight.
-
-
Constructor Details
-
FightManager
Constructor for parties -
FightManager
Constructor for solo monsters
-
-
Method Details
-
setPlayByPlayReporting
public static void setPlayByPlayReporting(boolean report) Set play-by-play reporting. -
getPlayByPlayReporting
public static boolean getPlayByPlayReporting()Get play-by-play reporting. -
reportPlayByPlay
private void reportPlayByPlay()Report play-by-play status. -
fight
Fight a duel between parties.- Returns:
- the winner of the fight
-
setInitiativeOrder
private void setInitiativeOrder()Set the initiative order. -
handleMemberChanges
private void handleMemberChanges()Handle membership changes for both sides (e.g., new creatures conjured or dispelled) -
callWinner
private void callWinner()Decide on the winner of a fight. -
getTurnCount
public int getTurnCount()Get current turn count. -
getWinner
Get the winner. -
winnerWonInit
public boolean winnerWonInit()Check if winner was first-mover? -
toString
Identify this object as a string.
-