Package struct
Class GameData
java.lang.Object
struct.GameData
The class dealing with invariable information in the game such as the screen
width of the stage and the chatacter's maximum HP.
-
Field Summary
Modifier and TypeFieldDescriptionprivate String[]
The both AIs' names.
Index 0 is P1, index 1 is P2.private String[]
The both characters' names.
Index 0 is P1, index 1 is P2.private int[]
The values of both characters' energy limits.
Index 0 is P1, index 1 is P2.private int[]
The values of both characters' HP limits.
Index 0 is P1, index 1 is P2. -
Method Summary
Modifier and TypeMethodDescriptiongetAiName
(boolean playerNumber) Returns the AI name of the specified player.getCharacterName
(boolean playerNumber) Returns the character name of the specified player.int
getMaxEnergy
(boolean playerNumber) Returns the maximum energy of the specified player.int
getMaxHP
(boolean playerNumber) Returns the maximum HP of the specified player.
-
Field Details
-
maxHPs
private int[] maxHPsThe values of both characters' HP limits.
Index 0 is P1, index 1 is P2. -
maxEnergies
private int[] maxEnergiesThe values of both characters' energy limits.
Index 0 is P1, index 1 is P2. -
characterNames
The both characters' names.
Index 0 is P1, index 1 is P2. -
aiNames
The both AIs' names.
Index 0 is P1, index 1 is P2.
-
-
Method Details
-
getMaxHP
public int getMaxHP(boolean playerNumber) Returns the maximum HP of the specified player.- Parameters:
playerNumber
- the player side's flag.true
if the player is P1, orfalse
if P2.- Returns:
- the maximum HP of the specified player
-
getMaxEnergy
public int getMaxEnergy(boolean playerNumber) Returns the maximum energy of the specified player.- Parameters:
playerNumber
- the player side's flag.true
if the player is P1, orfalse
if P2.- Returns:
- the maximum energy of the specified player
-
getCharacterName
Returns the character name of the specified player.- Parameters:
playerNumber
- the player side's flag.true
if the player is P1, orfalse
if P2.- Returns:
- the character name of the specified player
-
getAiName
Returns the AI name of the specified player.- Parameters:
playerNumber
- the player side's flag.true
if the player is P1, orfalse
if P2.- Returns:
- the AI name of the specified player
-