public class FrameData
extends java.lang.Object
Constructor and Description |
---|
FrameData()
The class constructor.
|
FrameData(CharacterData[] characterData,
int currentFrame,
int currentRound,
java.util.Deque<AttackData> projectileData)
The class constructor that creates a new instance of the FrameData class
by copying the data passed as the arguments.
|
FrameData(FrameData frameData)
A copy constructor that creates a copy of an instance of the FrameData
class by copying the values of the variables from an instance of the
FrameData class passed as the argument.
|
Modifier and Type | Method and Description |
---|---|
CharacterData |
getCharacter(boolean playerNumber)
Returns an instance of the CharacterData class of the player specified by
an argument.
|
int |
getDistanceX()
Returns the horizontal distance between P1 and P2.
|
int |
getDistanceY()
Returns the vertical distance between P1 and P2.
|
boolean |
getEmptyFlag()
Returns true if this instance is empty, false if it contains meaningful
data.
|
int |
getFramesNumber()
Returns the number of frames since the beginning of the round.
|
java.util.Deque<AttackData> |
getProjectiles()
Returns the projectile data of both characters.
|
java.util.Deque<AttackData> |
getProjectilesByP1()
Returns the projectile data of player 1.
|
java.util.Deque<AttackData> |
getProjectilesByP2()
Returns the projectile data of player 2.
|
int |
getRemainingFramesNumber()
Returns the number of remaining frames of the round.
|
int |
getRemainingTime()
Deprecated.
Use
getRemainingTimeMilliseconds() instead. This
method has been renamed to more clearly reflect its purpose. |
int |
getRemainingTimeMilliseconds()
Returns the expected remaining time in milliseconds of the current round.
|
int |
getRound()
Returns the current round number.
|
public FrameData()
public FrameData(CharacterData[] characterData, int currentFrame, int currentRound, java.util.Deque<AttackData> projectileData)
characterData
- an instance of the CharacterData classcurrentFrame
- the frame number of the current framecurrentRound
- the round number of the current roundprojectileData
- the queue that stores information on projectiles of P1 and P2CharacterData
,
KeyData
public FrameData(FrameData frameData)
frameData
- an instance of the FrameData classpublic CharacterData getCharacter(boolean playerNumber)
playerNumber
- the number of the player. true
if the player is P1, or
false
if P2.public int getRemainingTimeMilliseconds()
public int getRemainingTime()
getRemainingTimeMilliseconds()
instead. This
method has been renamed to more clearly reflect its purpose.public int getRemainingFramesNumber()
public int getFramesNumber()
public int getRound()
public java.util.Deque<AttackData> getProjectiles()
public java.util.Deque<AttackData> getProjectilesByP1()
public java.util.Deque<AttackData> getProjectilesByP2()
public boolean getEmptyFlag()
true
if this instance is empty, or false
if it
contains meaningful datapublic int getDistanceX()
public int getDistanceY()