public class KeyData
extends java.lang.Object
Constructor and Description |
---|
KeyData(int keyNumber) |
KeyData(Key[] keys)
Create KeyData from two inputs of Key
|
KeyData(KeyData keyData)
Copy constructor
|
Modifier and Type | Method and Description |
---|---|
Key[] |
getKey() |
Key |
getMyKey(boolean playerNumber)
Returns Key of your player character with the parameter player, returned from the method initialize in AIInterface.
|
Key |
getOpponentKey(boolean playerNumber)
Returns Key of the opponent' player character with the parameter player, returned from the method initialize in AIInterface.
|
Key |
getPlayerOne()
Returns P1's input.
|
Key |
getPlayerTwo()
Returns P2's input.
|
void |
setPlayerOne(Key playerOne)
Sets playerOne's input to P1.
|
void |
setPlayerTwo(Key playerTwo)
Sets playerTwo's input to P2.
|
public KeyData(int keyNumber)
public KeyData(Key[] keys)
key1
- Input of player 1key2
- Input of player 2public KeyData(KeyData keyData)
keyData
- Source datapublic Key[] getKey()
public Key getMyKey(boolean playerNumber)
playerNumber
- public Key getOpponentKey(boolean playerNumber)
playerNumber
- public Key getPlayerOne()
public Key getPlayerTwo()
public void setPlayerOne(Key playerOne)
playerOne
- P1's Key classpublic void setPlayerTwo(Key playerTwo)
playerTwo
- P2's Key class