Package struct

Class CharacterData

java.lang.Object
struct.CharacterData

public class CharacterData extends Object
The class dealing with data on the character such as the character's HP, energy, coordinates.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private Action
    The character's action.
    private AttackData
    The attack data that the character is using.
    private int
    The character's hit box's most-bottom y-coordinate.
    private boolean
    The flag whether this character can run a new motion with the motion's command.
    true if the character can run, false otherwise.
    private int
    The character's energy.
    private boolean
    The character's facing direction.
    true if the character is facing right, false otherwise.
    private int
    The amount of movement in the horizontal direction used to adjust the x coordinate when determining the direction of the character.
    private int
    The character's graphic width.
    private int
    The character's graphic height.
    private boolean
    The flag whether the motion hits the opponent or not.
    private int
    The continuous hit count of attacks used by this character.
    private int
    The character's HP.
    private int
    The frame number of the last frame that an attack used by this character hit the opponent.
    private int
    The character's hit box's most-left x-coordinate.
    private boolean
    The character's side flag.
    true if the character is P1, or false if P2.
    private int
    The number of frames that the character needs to resume to its normal status.
    private int
    The character's hit box's most-right x-coordinate.
    private int
    The character's horizontal speed.
    private int
    The character's vertical speed.
    private State
    The character's state: STAND / CROUCH / AIR / DOWN.
    private int
    The character's hit box's most-top y-coordinate.
    private int
    The character graphic's most top-left x-coordinate.
    private int
    The character graphic's most top-left y-coordinate.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the character's action.
    Returns the attack data that the character is using.
    int
    Returns the character's hit box's most-bottom y-coordinate.
    int
    Returns the character's hit box's center x-coordinate.
    int
    Returns the character's hit box's center y-coordinate.
    int
    Returns the character's energy.
    int
    Returns the amount of movement in the horizontal direction used to adjust the x coordinate when determining the direction of the character.
    int
    Returns the character's graphic width.
    int
    Returns the character's graphic height.
    int
    Returns the continuous hit count of attacks used by this character.
    int
    Returns the character's HP.
    int
    Returns the frame number of the last frame that an attack used by this character hit the opponent.
    int
    Returns the character's hit box's most-left x-coordinate.
    int
    Returns the number of frames that the character needs to resume to its normal status.
    int
    Returns the character's hit box's most-right x-coordinate.
    int
    Returns the character's horizontal speed.
    int
    Returns the character's vertical speed.
    Returns the character's state: STAND / CROUCH/ AIR / DOWN.
    int
    Returns the character's hit box's most-top y-coordinate.
    int
    Deprecated.
    int
    Deprecated.
    boolean
    Returns the flag whether this character can run a new motion with the motion's command.
    boolean
    Returns the character's facing direction.
    boolean
    Returns the flag whether the motion hits the opponent or not.
    boolean
    Returns the character's side flag.
    void
    setAction(Action action)
    Sets the character's action.
    void
    Sets the character's attack.
    void
    setBottom(int bottom)
    Sets the character's hit box's most-bottom y-coordinate
    void
    setControl(boolean control)
    Sets the flag whether this character can run a new motion with the motion's command.
    void
    setEnergy(int energy)
    Sets the character's energy.
    void
    setFront(boolean front)
    Sets the character's facing direction.
    void
    setHitConfirm(boolean hitConfirm)
    Sets a boolean value whether the motion hits the opponent or not.
    void
    setHitCount(int hitCount)
    Sets the continuous hit count of attacks used by this character.
    void
    setHp(int hp)
    Sets the character's HP.
    void
    setLastHitFrame(int lastHitFrame)
    Sets the frame number of the last frame that an attack used by this character hit the opponent.
    void
    setLeft(int left)
    Sets the character's hit box's most-left x-coordinate
    void
    setRemainingFrame(int remainingFrame)
    Sets the number of frames that the character needs to resume to its normal status.
    void
    setRight(int right)
    Sets the character's hit box's most-right x-coordinate.
    void
    setSpeedX(int speedX)
    Sets the character's horizontal speed.
    void
    setSpeedY(int speedY)
    Sets the character's vertical speed.
    void
    setState(State state)
    Sets the character's state.
    void
    setTop(int top)
    Sets the character's hit box's most-top y-coordinate
    void
    setX(int x)
    Sets the character's horizontal position.
    void
    setY(int y)
    Sets the character's vertical position.

    Methods inherited from class java.lang.Object

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

    • playerNumber

      private boolean playerNumber
      The character's side flag.
      true if the character is P1, or false if P2.
    • hp

      private int hp
      The character's HP.
    • energy

      private int energy
      The character's energy.
    • x

      private int x
      The character graphic's most top-left x-coordinate.
    • y

      private int y
      The character graphic's most top-left y-coordinate.
    • left

      private int left
      The character's hit box's most-left x-coordinate.
    • top

      private int top
      The character's hit box's most-top y-coordinate.
    • bottom

      private int bottom
      The character's hit box's most-bottom y-coordinate.
    • speedX

      private int speedX
      The character's horizontal speed.
    • speedY

      private int speedY
      The character's vertical speed.
    • state

      private State state
      The character's state: STAND / CROUCH / AIR / DOWN.
    • action

      private Action action
      The character's action.
    • front

      private boolean front
      The character's facing direction.
      true if the character is facing right, false otherwise.
    • control

      private boolean control
      The flag whether this character can run a new motion with the motion's command.
      true if the character can run, false otherwise.
    • attackData

      private AttackData attackData
      The attack data that the character is using.
    • remainingFrame

      private int remainingFrame
      The number of frames that the character needs to resume to its normal status.
    • hitConfirm

      private boolean hitConfirm
      The flag whether the motion hits the opponent or not. true if the motion hits the opponent, false otherwise.
    • graphicSizeX

      private int graphicSizeX
      The character's graphic width.
    • graphicSizeY

      private int graphicSizeY
      The character's graphic height.
    • graphicAdjustX

      private int graphicAdjustX
      The amount of movement in the horizontal direction used to adjust the x coordinate when determining the direction of the character.
    • hitCount

      private int hitCount
      The continuous hit count of attacks used by this character.
    • lastHitFrame

      private int lastHitFrame
      The frame number of the last frame that an attack used by this character hit the opponent.
  • Method Details

    • isPlayerNumber

      public boolean isPlayerNumber()
      Returns the character's side flag.
      Returns:
      true if the character is P1, or false if P2
    • isFront

      public boolean isFront()
      Returns the character's facing direction.
      Returns:
      true if the character is facing right, false otherwise
    • isControl

      public boolean isControl()
      Returns the flag whether this character can run a new motion with the motion's command.
      Returns:
      true if the character can run, false otherwise
    • getHp

      public int getHp()
      Returns the character's HP.
      Returns:
      the character's HP
    • getEnergy

      public int getEnergy()
      Returns the character's energy.
      Returns:
      the character's energy
    • getX

      public int getX()
      Deprecated.
      Returns the character graphic's most top-left x-coordinate.
      Returns:
      the character graphic's most top-left x-coordinate
    • getY

      public int getY()
      Deprecated.
      Returns the character graphic's most top-left y-coordinate.
      Returns:
      the character graphic's most top-left y-coordinate
    • getLeft

      public int getLeft()
      Returns the character's hit box's most-left x-coordinate.
      Returns:
      the character's hit box's most-left x-coordinate
    • getRight

      public int getRight()
      Returns the character's hit box's most-right x-coordinate.
      Returns:
      the character's hit box's most-right x-coordinate
    • getTop

      public int getTop()
      Returns the character's hit box's most-top y-coordinate.
      Returns:
      the character's hit box's most-top y-coordinate
    • getBottom

      public int getBottom()
      Returns the character's hit box's most-bottom y-coordinate.
      Returns:
      the character's hit box's most-bottom y-coordinate
    • getCenterX

      public int getCenterX()
      Returns the character's hit box's center x-coordinate.
      Returns:
      the character's hit box's center x-coordinate
    • getCenterY

      public int getCenterY()
      Returns the character's hit box's center y-coordinate.
      Returns:
      the character's hit box's center y-coordinate
    • getSpeedX

      public int getSpeedX()
      Returns the character's horizontal speed.
      Returns:
      the character's horizontal speed
    • getSpeedY

      public int getSpeedY()
      Returns the character's vertical speed.
      Returns:
      the character's vertical speed
    • getState

      public State getState()
      Returns the character's state: STAND / CROUCH/ AIR / DOWN.
      Returns:
      the character's state: STAND / CROUCH/ AIR / DOWN
      See Also:
    • getAction

      public Action getAction()
      Returns the character's action.
      Returns:
      the character's action
      See Also:
    • getRemainingFrame

      public int getRemainingFrame()
      Returns the number of frames that the character needs to resume to its normal status.
      Returns:
      the number of frames that the character needs to resume to its normal status
    • getAttack

      public AttackData getAttack()
      Returns the attack data that the character is using.
      Returns:
      the attack data that the character is using
      See Also:
    • getGraphicSizeX

      public int getGraphicSizeX()
      Returns the character's graphic width.
      Returns:
      the character's graphic width
    • getGraphicSizeY

      public int getGraphicSizeY()
      Returns the character's graphic height.
      Returns:
      the character's graphic height
    • getGraphicAdjustX

      public int getGraphicAdjustX()
      Returns the amount of movement in the horizontal direction used to adjust the x coordinate when determining the direction of the character.
      Returns:
      the amount of movement in the horizontal direction used to adjust the x coordinate
    • isHitConfirm

      public boolean isHitConfirm()
      Returns the flag whether the motion hits the opponent or not.
      Returns:
      true if the motion hits the opponent, false otherwise
    • getHitCount

      public int getHitCount()
      Returns the continuous hit count of attacks used by this character.
      Returns:
      the continuous hit count of attacks used by this character
    • getLastHitFrame

      public int getLastHitFrame()
      Returns the frame number of the last frame that an attack used by this character hit the opponent.
      Returns:
      the frame number of the last frame that an attack used by this character hit the opponent
    • setHp

      public void setHp(int hp)
      Sets the character's HP.
      Parameters:
      hp - the amount of HP
    • setEnergy

      public void setEnergy(int energy)
      Sets the character's energy.
      Parameters:
      energy - the amount of energy
    • setX

      public void setX(int x)
      Sets the character's horizontal position.
      Parameters:
      x - the character's horizontal position
    • setY

      public void setY(int y)
      Sets the character's vertical position.
      Parameters:
      y - the character's vertical position
    • setSpeedX

      public void setSpeedX(int speedX)
      Sets the character's horizontal speed.
      Parameters:
      speedX - the character's horizontal speed
    • setSpeedY

      public void setSpeedY(int speedY)
      Sets the character's vertical speed.
      Parameters:
      speedY - the character's vertical speed
    • setState

      public void setState(State state)
      Sets the character's state.
      Parameters:
      state - a given state
      See Also:
    • setAction

      public void setAction(Action action)
      Sets the character's action.
      Parameters:
      action - a given action
      See Also:
    • setFront

      public void setFront(boolean front)
      Sets the character's facing direction.
      Parameters:
      front - the character's facing direction. true if the character is facing right, false otherwise.
    • setControl

      public void setControl(boolean control)
      Sets the flag whether this character can run a new motion with the motion's command.
      Parameters:
      control - the flag whether this character can run a new motion with the motion's command. true if the character can run, false otherwise.
    • setRemainingFrame

      public void setRemainingFrame(int remainingFrame)
      Sets the number of frames that the character needs to resume to its normal status.
      Parameters:
      remainingFrame - the number of frames that the character needs to resume to its normal status you want to set
    • setTop

      public void setTop(int top)
      Sets the character's hit box's most-top y-coordinate
      Parameters:
      top - the integer value you want to set
    • setBottom

      public void setBottom(int bottom)
      Sets the character's hit box's most-bottom y-coordinate
      Parameters:
      bottom - the integer value you want to set
    • setLeft

      public void setLeft(int left)
      Sets the character's hit box's most-left x-coordinate
      Parameters:
      left - the character's hit box's most-left x-coordinate you want to set
    • setRight

      public void setRight(int right)
      Sets the character's hit box's most-right x-coordinate.
      Parameters:
      right - the character's hit box's most-right x-coordinate you want to set
    • setAttack

      public void setAttack(AttackData attack)
      Sets the character's attack.
      Parameters:
      attack - the attack you want to set
      See Also:
    • setHitCount

      public void setHitCount(int hitCount)
      Sets the continuous hit count of attacks used by this character.
      Parameters:
      hitCount - the continuous hit count of attacks used by this character
    • setLastHitFrame

      public void setLastHitFrame(int lastHitFrame)
      Sets the frame number of the last frame that an attack used by this character hit the opponent.
      Parameters:
      lastHitFrame - the frame number of the last frame that an attack used by this character hit the opponent
    • setHitConfirm

      public void setHitConfirm(boolean hitConfirm)
      Sets a boolean value whether the motion hits the opponent or not.
      Parameters:
      hitConfirm - a boolean value whether the motion hits the opponent or not. true if the motion hits the opponent, false otherwise.