public class Input
extends java.lang.Thread
Constructor and Description |
---|
Input() |
Modifier and Type | Method and Description |
---|---|
boolean |
FlagControl(boolean FlagCtrl)
Set endFlag to true to end the program.
|
KeyData |
GetKeyData() |
Key |
GetKeyDataPlayerOne(Key buf)
Returns the input data from P1.
|
Key |
GetKeyDataPlayerTwo(Key buf2)
Returns the input data from P2.
|
Key |
getPlayerOneAIInput(Key buf)
Returns the input data from PlayerOneAI.
|
Key |
getPlayerTwoAIInput(Key buf)
Returns the input data from PlayerTwoAI.
|
void |
initialize(boolean PlayerOneAIFlag,
boolean PlayerTwoAIFlag,
AILoader PlayerOneAIAddress,
AILoader PlayerTwoAIAddress)
Initialize KeyData class.
|
void |
notifyStop()
This class will be stopped when this method is called.
|
void |
run() |
void |
UpdateKeyData(Key save1,
Key save2)
Save the input data to keydata.
|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
public void initialize(boolean PlayerOneAIFlag, boolean PlayerTwoAIFlag, AILoader PlayerOneAIAddress, AILoader PlayerTwoAIAddress)
PlayerOneAIFlag
- Returns true if P1 is an AI controllerPlayerTwoAIFlag
- Returns true if P2 is an AI controllerPlayerOneAIAddress
- The AI controller file's path of P1.PlayerTwoAIAddress
- The AI controller file's path of P2.public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public boolean FlagControl(boolean FlagCtrl)
FlagCtrl
- booleanpublic Key getPlayerOneAIInput(Key buf)
buf
- P1's Keypublic Key getPlayerTwoAIInput(Key buf)
buf
- P2's Keypublic Key GetKeyDataPlayerOne(Key buf)
buf
- P1's Keypublic Key GetKeyDataPlayerTwo(Key buf2)
buf
- P2's Keypublic void UpdateKeyData(Key save1, Key save2)
save1
- P1's Key datasave2
- P2's Key datapublic KeyData GetKeyData()
public void notifyStop()