Package struct
Class FrameData
java.lang.Object
struct.FrameData
The class dealing with the information in the game such as the current frame
 number, number of rounds and character information.
- 
Field Summary
FieldsModifier and TypeFieldDescriptionprivate CharacterData[]The character's data of both characters
Index 0 is P1, index 1 is P2.private intThe current frame of the round.private intThe current round number.private booleanIf this value is true, no data are available or they are dummy data.private boolean[]The facing direction of both charactersprivate Deque<AttackData>The projectile data of both characters. - 
Method Summary
Modifier and TypeMethodDescriptiongetCharacter(boolean playerNumber) Returns an instance of the CharacterData class of the player specified by an argument.intReturns the horizontal distance between P1 and P2.intReturns the vertical distance between P1 and P2.booleanReturns true if this instance is empty, false if it contains meaningful data.intReturns the number of frames since the beginning of the round.Returns the projectile data of both characters.Returns the projectile data of player 1.Returns the projectile data of player 2.intgetRound()Returns the current round number.booleanisFront(boolean player) The character's facing direction. 
- 
Field Details
- 
characterData
The character's data of both characters
Index 0 is P1, index 1 is P2. - 
currentFrameNumber
private int currentFrameNumberThe current frame of the round. - 
currentRound
private int currentRoundThe current round number. - 
projectileData
The projectile data of both characters. - 
emptyFlag
private boolean emptyFlagIf this value is true, no data are available or they are dummy data. - 
front
private boolean[] frontThe facing direction of both characters 
 - 
 - 
Method Details
- 
getCharacter
Returns an instance of the CharacterData class of the player specified by an argument.- Parameters:
 playerNumber- the number of the player.trueif the player is P1, orfalseif P2.- Returns:
 - an instance of the CharacterData class of the player
 
 - 
getFramesNumber
public int getFramesNumber()Returns the number of frames since the beginning of the round.- Returns:
 - the number of frames since the beginning of the round
 
 - 
getRound
public int getRound()Returns the current round number.- Returns:
 - the current round number
 
 - 
getProjectiles
Returns the projectile data of both characters.- Returns:
 - the projectile data of both characters
 
 - 
getProjectilesByP1
Returns the projectile data of player 1.- Returns:
 - the projectile data of player 1
 
 - 
getProjectilesByP2
Returns the projectile data of player 2.- Returns:
 - the projectile data of player 2
 
 - 
getEmptyFlag
public boolean getEmptyFlag()Returns true if this instance is empty, false if it contains meaningful data.- Returns:
 trueif this instance is empty, orfalseif it contains meaningful data
 - 
getDistanceX
public int getDistanceX()Returns the horizontal distance between P1 and P2.- Returns:
 - the horizontal distance between P1 and P2
 
 - 
getDistanceY
public int getDistanceY()Returns the vertical distance between P1 and P2.- Returns:
 - the vertical distance between P1 and P2
 
 - 
isFront
public boolean isFront(boolean player) The character's facing direction.- Parameters:
 player- The character's side flag- Returns:
 trueif the character is facing right,falseotherwise.
 
 -