2020-04-16 10:03:52 +02:00
|
|
|
package inf112.fiasko.roborally.objects;
|
|
|
|
|
|
|
|
import inf112.fiasko.roborally.elementproperties.GameState;
|
2020-04-20 13:13:04 +02:00
|
|
|
import inf112.fiasko.roborally.networking.containers.PowerDownContainer;
|
2020-04-16 14:51:42 +02:00
|
|
|
import inf112.fiasko.roborally.networking.containers.ProgamsContainer;
|
|
|
|
|
|
|
|
import java.util.List;
|
2020-04-16 10:03:52 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This interface describes
|
|
|
|
*/
|
2020-04-20 13:13:04 +02:00
|
|
|
public interface InteractableGame {
|
2020-04-16 10:03:52 +02:00
|
|
|
/**
|
|
|
|
* Gets the current state og the game
|
2020-04-20 13:13:04 +02:00
|
|
|
*
|
2020-04-16 10:03:52 +02:00
|
|
|
* @return The state the game is currently in
|
|
|
|
*/
|
|
|
|
GameState getGameState();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the state of the game
|
2020-04-20 13:13:04 +02:00
|
|
|
*
|
2020-04-16 10:03:52 +02:00
|
|
|
* @param gameState The new state of the game
|
|
|
|
*/
|
|
|
|
void setGameState(GameState gameState);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the name of the player who won
|
2020-04-20 13:13:04 +02:00
|
|
|
*
|
2020-04-16 10:03:52 +02:00
|
|
|
* @return A string of the player name
|
|
|
|
*/
|
|
|
|
String getWinningPlayerName();
|
2020-04-16 14:51:42 +02:00
|
|
|
|
2020-04-20 21:43:47 +02:00
|
|
|
/**
|
|
|
|
* Sets the name of the player that won the game
|
|
|
|
*
|
|
|
|
* @param winningPlayerName The player winning the game
|
|
|
|
*/
|
|
|
|
void setWinningPlayerName(String winningPlayerName);
|
|
|
|
|
2020-04-17 11:43:47 +02:00
|
|
|
/**
|
|
|
|
* Continues turn when programs for all players are received from the server
|
2020-04-20 13:13:04 +02:00
|
|
|
*
|
2020-04-17 11:43:47 +02:00
|
|
|
* @param programs The programs container received from the server
|
|
|
|
* @throws InterruptedException If interrupted during sleep
|
|
|
|
*/
|
|
|
|
void receiveAllPrograms(ProgamsContainer programs) throws InterruptedException;
|
2020-04-16 14:51:42 +02:00
|
|
|
|
2020-04-17 11:43:47 +02:00
|
|
|
/**
|
|
|
|
* Continues turn when stay in power down is received from all players
|
2020-04-20 13:13:04 +02:00
|
|
|
*
|
2020-04-17 11:43:47 +02:00
|
|
|
* @param powerDowns The power down container received from the server
|
|
|
|
*/
|
2020-04-20 13:13:04 +02:00
|
|
|
void receiveStayInPowerDown(PowerDownContainer powerDowns);
|
2020-04-16 14:51:42 +02:00
|
|
|
|
2020-04-17 11:43:47 +02:00
|
|
|
/**
|
|
|
|
* Gets the hand of this player
|
2020-04-20 13:13:04 +02:00
|
|
|
*
|
2020-04-17 11:43:47 +02:00
|
|
|
* @return The hand of this player
|
|
|
|
*/
|
|
|
|
ProgrammingCardDeck getPlayerHand();
|
2020-04-16 14:51:42 +02:00
|
|
|
|
2020-04-17 11:43:47 +02:00
|
|
|
/**
|
|
|
|
* Sets the hand of this player
|
2020-04-20 13:13:04 +02:00
|
|
|
*
|
2020-04-17 11:43:47 +02:00
|
|
|
* @param playerHand The new hand of this player
|
|
|
|
*/
|
2020-04-16 14:51:42 +02:00
|
|
|
void setPlayerHand(ProgrammingCardDeck playerHand);
|
|
|
|
|
2020-04-17 11:43:47 +02:00
|
|
|
/**
|
|
|
|
* Gets the amount of cards the player can choose for their program
|
2020-04-20 13:13:04 +02:00
|
|
|
*
|
2020-04-17 11:43:47 +02:00
|
|
|
* @return The size of the player's next program
|
|
|
|
*/
|
|
|
|
int getProgramSize();
|
2020-04-16 14:51:42 +02:00
|
|
|
|
2020-04-17 11:43:47 +02:00
|
|
|
/**
|
|
|
|
* Gets the program of this player
|
2020-04-20 13:13:04 +02:00
|
|
|
*
|
2020-04-17 11:43:47 +02:00
|
|
|
* @return The program of this player
|
|
|
|
*/
|
|
|
|
List<ProgrammingCard> getProgram();
|
2020-04-16 14:51:42 +02:00
|
|
|
|
2020-04-17 11:43:47 +02:00
|
|
|
/**
|
|
|
|
* Sets the program of this player
|
2020-04-20 13:13:04 +02:00
|
|
|
*
|
2020-04-17 11:43:47 +02:00
|
|
|
* @param program The program of this player
|
|
|
|
*/
|
|
|
|
void setProgram(List<ProgrammingCard> program);
|
2020-04-16 14:51:42 +02:00
|
|
|
|
2020-04-16 10:03:52 +02:00
|
|
|
}
|