Package struct

Class GameData

java.lang.Object
struct.GameData

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

    Fields
    Modifier and Type
    Field
    Description
    private 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 Type
    Method
    Description
    getAiName(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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • maxHPs

      private int[] maxHPs
      The values of both characters' HP limits.
      Index 0 is P1, index 1 is P2.
    • maxEnergies

      private int[] maxEnergies
      The values of both characters' energy limits.
      Index 0 is P1, index 1 is P2.
    • characterNames

      private String[] characterNames
      The both characters' names.
      Index 0 is P1, index 1 is P2.
    • aiNames

      private String[] 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, or false 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, or false if P2.
      Returns:
      the maximum energy of the specified player
    • getCharacterName

      public String getCharacterName(boolean playerNumber)
      Returns the character name of the specified player.
      Parameters:
      playerNumber - the player side's flag. true if the player is P1, or false if P2.
      Returns:
      the character name of the specified player
    • getAiName

      public String getAiName(boolean playerNumber)
      Returns the AI name of the specified player.
      Parameters:
      playerNumber - the player side's flag. true if the player is P1, or false if P2.
      Returns:
      the AI name of the specified player