added init for mdga with all states and messages
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
package pp.mdga.client;
|
||||
|
||||
public class AudioSettings extends Settings {
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package pp.mdga.client;
|
||||
|
||||
public class Ceremony extends ClientState {
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package pp.mdga.client;
|
||||
|
||||
public class ChoosePiece extends Turn {
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package pp.mdga.client;
|
||||
|
||||
public class ChoosePowerCard extends PowerCard {
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package pp.mdga.client;
|
||||
|
||||
public class ClientGameLogic {
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package pp.mdga.client;
|
||||
|
||||
public class ClientState {
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package pp.mdga.client;
|
||||
|
||||
public class DetermineStartPlayer extends Game {
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package pp.mdga.client;
|
||||
|
||||
public class Dialogs extends ClientState {
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package pp.mdga.client;
|
||||
|
||||
public class Game extends ClientState {
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package pp.mdga.client;
|
||||
|
||||
public class Interrupt extends ClientState {
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package pp.mdga.client;
|
||||
|
||||
public class Lobby extends Dialogs {
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package pp.mdga.client;
|
||||
|
||||
public class MainSettings extends Settings {
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package pp.mdga.client;
|
||||
|
||||
public class MovePiece extends Turn {
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package pp.mdga.client;
|
||||
|
||||
public class NetworkDialog extends Dialogs {
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package pp.mdga.client;
|
||||
|
||||
public class NoPiece extends ChoosePiece {
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package pp.mdga.client;
|
||||
|
||||
public class PlayPowerCard extends PowerCard {
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package pp.mdga.client;
|
||||
|
||||
public class PowerCard extends Turn {
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package pp.mdga.client;
|
||||
|
||||
public class RollDice extends Turn {
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package pp.mdga.client;
|
||||
|
||||
public class RollRankingDice extends DetermineStartPlayer {
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package pp.mdga.client;
|
||||
|
||||
public class SelectPiece extends ChoosePiece {
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package pp.mdga.client;
|
||||
|
||||
public class Settings {
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package pp.mdga.client;
|
||||
|
||||
public class Shield extends PowerCard {
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package pp.mdga.client;
|
||||
|
||||
public class Spectator extends Game {
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package pp.mdga.client;
|
||||
|
||||
public class StartDialog extends ClientState {
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package pp.mdga.client;
|
||||
|
||||
public class StartPiece extends ChoosePiece {
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package pp.mdga.client;
|
||||
|
||||
public class SwitchEnemy extends PowerCard {
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package pp.mdga.client;
|
||||
|
||||
public class SwitchOwn extends PowerCard {
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package pp.mdga.client;
|
||||
|
||||
public class Turn extends Game {
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package pp.mdga.client;
|
||||
|
||||
public class VideoSettings extends Settings {
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package pp.mdga.client;
|
||||
|
||||
public class WaitRanking extends DetermineStartPlayer {
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package pp.mdga.client;
|
||||
|
||||
public class Waiting extends Game {
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package pp.mdga.client;
|
||||
|
||||
public class WaitingPiece extends ChoosePiece {
|
||||
}
|
||||
45
Projekte/mdga/model/src/main/java/pp.mdga/game/Board.java
Normal file
45
Projekte/mdga/model/src/main/java/pp.mdga/game/Board.java
Normal file
@@ -0,0 +1,45 @@
|
||||
package pp.mdga.game;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* This class will be used to hold all Board relevant data.
|
||||
*/
|
||||
public class Board {
|
||||
private Map<Color, Player> playerData;
|
||||
private Node[] infield;
|
||||
|
||||
/**
|
||||
* This constructor is used to create a new board
|
||||
*/
|
||||
public Board() {
|
||||
infield = new Node[40];
|
||||
for (int i = 0; i < 40; i++) {
|
||||
if (i % 10 == 0) {
|
||||
infield[i] = new StartNode();
|
||||
} else if (i == 4 || i == 14 || i == 24 || i == 34) {
|
||||
infield[i] = new BonusNode();
|
||||
} else {
|
||||
infield[i] = new Node();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This method returns the playerData
|
||||
*
|
||||
* @return the playerData
|
||||
*/
|
||||
public Map<Color, Player> getPlayerData() {
|
||||
return playerData;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method returns the infield
|
||||
*
|
||||
* @return the infield
|
||||
*/
|
||||
public Node[] getInfield() {
|
||||
return infield;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package pp.mdga.game;
|
||||
|
||||
public enum BonusCard {
|
||||
HIDDERN,
|
||||
SHIELD,
|
||||
TURBO,
|
||||
SWAP
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package pp.mdga.game;
|
||||
|
||||
public class BonusNode extends Node {
|
||||
|
||||
public BonusNode() {}
|
||||
|
||||
/**
|
||||
* This method is used to set a new Occupant
|
||||
*
|
||||
* @param occupant the new occupant of the node
|
||||
*/
|
||||
@Override
|
||||
public void setOccupant(Piece occupant) {
|
||||
if (occupant.isSuppressed()){
|
||||
occupant.setShield(ShieldState.NONE);
|
||||
}
|
||||
//Draw Card Event
|
||||
this.occupant = occupant;
|
||||
}
|
||||
}
|
||||
34
Projekte/mdga/model/src/main/java/pp.mdga/game/Card.java
Normal file
34
Projekte/mdga/model/src/main/java/pp.mdga/game/Card.java
Normal file
@@ -0,0 +1,34 @@
|
||||
package pp.mdga.game;
|
||||
/**
|
||||
* This class is used to create a card
|
||||
*/
|
||||
public class Card {
|
||||
private BonusCard type;
|
||||
|
||||
/**
|
||||
* This constructor is used to create a new card
|
||||
*
|
||||
* @param type the type of the card
|
||||
*/
|
||||
public Card(BonusCard type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is used to get the type of the card
|
||||
*
|
||||
* @return the type of the card
|
||||
*/
|
||||
public BonusCard getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is used to set the type of the card
|
||||
*
|
||||
* @param type the new type of the card
|
||||
*/
|
||||
public void setType(BonusCard type) {
|
||||
this.type = type;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package pp.mdga.game;
|
||||
|
||||
public enum Color {
|
||||
ARMY,
|
||||
NAVY,
|
||||
CYBER,
|
||||
AIRFORCE
|
||||
|
||||
}
|
||||
37
Projekte/mdga/model/src/main/java/pp.mdga/game/Game.java
Normal file
37
Projekte/mdga/model/src/main/java/pp.mdga/game/Game.java
Normal file
@@ -0,0 +1,37 @@
|
||||
package pp.mdga.game;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedList;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* This class will be used to handle the data stored in the model
|
||||
*/
|
||||
public class Game {
|
||||
private int diceModifier = 1;
|
||||
private int diceEyes;
|
||||
private Map <Color, Player> players;
|
||||
private Statistic gameStatistics;
|
||||
private ArrayList<Card> drawPile;
|
||||
private ArrayList<Card> discardPile = new ArrayList<>();
|
||||
private Board board;
|
||||
private Color activeColor;
|
||||
private LinkedList<Color> order;
|
||||
private Map<Color, Integer> playerConnectionID;
|
||||
|
||||
private static final int AMOUNT_OF_TURBO_CARDS = 16;
|
||||
private static final int AMOUNT_OF_SHIELD_AND_SWAP_CARDS = 12;
|
||||
|
||||
public Game(){
|
||||
gameStatistics = new Statistic();
|
||||
drawPile = new ArrayList<>();
|
||||
for (int i = 0; i < AMOUNT_OF_TURBO_CARDS; i++) {
|
||||
drawPile.add(new Card(BonusCard.TURBO));
|
||||
}
|
||||
for (int i = 0; i < AMOUNT_OF_SHIELD_AND_SWAP_CARDS; i++) {
|
||||
drawPile.add(new Card(BonusCard.SHIELD));
|
||||
drawPile.add(new Card(BonusCard.SWAP));
|
||||
}
|
||||
board = new Board();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package pp.mdga.game;
|
||||
|
||||
public class HomeNode extends Node {
|
||||
|
||||
public HomeNode() {}
|
||||
}
|
||||
47
Projekte/mdga/model/src/main/java/pp.mdga/game/Node.java
Normal file
47
Projekte/mdga/model/src/main/java/pp.mdga/game/Node.java
Normal file
@@ -0,0 +1,47 @@
|
||||
package pp.mdga.game;
|
||||
|
||||
/**
|
||||
* This class will be used the represent a Node on which the pieces can travel along
|
||||
*/
|
||||
public class Node {
|
||||
protected Piece occupant;
|
||||
|
||||
public Node() {}
|
||||
|
||||
/**
|
||||
* This method is used to get an occupant of the Node.
|
||||
*
|
||||
* @return the current occupant of the node
|
||||
*/
|
||||
public Piece getOccupant() {
|
||||
return occupant;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is used to set a new Occupant
|
||||
*
|
||||
* @param occupant the new occupant of the node
|
||||
*/
|
||||
public void setOccupant(Piece occupant) {
|
||||
if (occupant.isSuppressed()){
|
||||
occupant.setShield(ShieldState.NONE);
|
||||
}
|
||||
this.occupant = occupant;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is used to clear the node of its occupant
|
||||
*/
|
||||
public void clearOccupant() {
|
||||
this.occupant = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is used to return a boolean value based on the occupation status
|
||||
*
|
||||
* @return the boolean value corresponding to the occupation status
|
||||
*/
|
||||
public boolean isOccupied() {
|
||||
return occupant != null;
|
||||
}
|
||||
}
|
||||
37
Projekte/mdga/model/src/main/java/pp.mdga/game/Piece.java
Normal file
37
Projekte/mdga/model/src/main/java/pp.mdga/game/Piece.java
Normal file
@@ -0,0 +1,37 @@
|
||||
package pp.mdga.game;
|
||||
|
||||
public class Piece {
|
||||
private ShieldState shield;
|
||||
private PieceState state;
|
||||
private Color color;
|
||||
|
||||
public Piece(Color color, PieceState state) {
|
||||
this.color = color;
|
||||
this.state = state;
|
||||
shield = ShieldState.NONE;
|
||||
}
|
||||
|
||||
public void setShield(ShieldState shield) {
|
||||
this.shield = shield;
|
||||
}
|
||||
|
||||
public ShieldState getShield() {
|
||||
return shield;
|
||||
}
|
||||
|
||||
public void setState(PieceState state) {
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
public PieceState getState() {
|
||||
return state;
|
||||
}
|
||||
|
||||
public boolean isShielded() {
|
||||
return shield == ShieldState.ACTIVE;
|
||||
}
|
||||
|
||||
public boolean isSuppressed() {
|
||||
return shield == ShieldState.SUPPRESSED;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package pp.mdga.game;
|
||||
|
||||
public enum PieceState {
|
||||
ACTIVE,
|
||||
WAITING,
|
||||
HOME,
|
||||
HOMEFINISHED
|
||||
}
|
||||
82
Projekte/mdga/model/src/main/java/pp.mdga/game/Player.java
Normal file
82
Projekte/mdga/model/src/main/java/pp.mdga/game/Player.java
Normal file
@@ -0,0 +1,82 @@
|
||||
package pp.mdga.game;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* This class will be used to handle general PlayerData
|
||||
*/
|
||||
public class Player {
|
||||
|
||||
private String name;
|
||||
private Statistic playerStatistic;
|
||||
private ArrayList<Card> handCards;
|
||||
private final int id;
|
||||
|
||||
/**
|
||||
* This constructor constructs a new Player object
|
||||
*/
|
||||
public Player(int id) {
|
||||
this.id = id;
|
||||
playerStatistic = new Statistic();
|
||||
handCards = new ArrayList<>();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method returns the give name of the Player
|
||||
*
|
||||
* @return the name of the player as a String
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method sets the name of the player
|
||||
*
|
||||
* @param name the new name of the player
|
||||
*/
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* This methode returns the statistics of the player
|
||||
*
|
||||
* @return the statistics of the player
|
||||
*/
|
||||
public Statistic getPlayerStatistic() {
|
||||
return playerStatistic;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method returns the current handCards of the player
|
||||
*
|
||||
* @return the handCards of the player
|
||||
*/
|
||||
public ArrayList<Card> getHandCards() {
|
||||
return handCards;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method adds a new handCard to the player
|
||||
*
|
||||
* @param cards the card to be added to the players hand
|
||||
*/
|
||||
public void addHandCards(Card cards){
|
||||
handCards.add(cards);
|
||||
}
|
||||
|
||||
/**
|
||||
* This method returns a BonusCard to be removed from the players hand.
|
||||
*
|
||||
* @param card the cards type to be removed
|
||||
* @return the removed card or null if there is none of that card type
|
||||
*/
|
||||
public Card removeHandCard(Card card) {
|
||||
Card cardToRemove = handCards.stream().filter(card1 -> card1.getType().equals(card.getType())).findFirst().orElse(null);
|
||||
if (cardToRemove != null) {
|
||||
handCards.remove(cardToRemove);
|
||||
}
|
||||
return cardToRemove;
|
||||
}
|
||||
}
|
||||
101
Projekte/mdga/model/src/main/java/pp.mdga/game/PlayerData.java
Normal file
101
Projekte/mdga/model/src/main/java/pp.mdga/game/PlayerData.java
Normal file
@@ -0,0 +1,101 @@
|
||||
package pp.mdga.game;
|
||||
|
||||
/**
|
||||
* This class is used to represent PlayerData related to the board
|
||||
*/
|
||||
public class PlayerData {
|
||||
private HomeNode[] homeNodes;
|
||||
private int startNodeIndex;
|
||||
private Piece[] waitingArea;
|
||||
private Piece[] pieces;
|
||||
|
||||
/**
|
||||
* This constructor is used to create a new PlayerData object
|
||||
*
|
||||
* @param color the color of the player
|
||||
*/
|
||||
public PlayerData(Color color) {
|
||||
homeNodes = new HomeNode[4];
|
||||
waitingArea = new Piece[4];
|
||||
for (int i = 0; i < 4; i++) {
|
||||
homeNodes[i] = new HomeNode();
|
||||
pieces[i] = new Piece(color, PieceState.WAITING);
|
||||
waitingArea[i] = pieces[i];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This method returns an Array of HomeNodes
|
||||
*
|
||||
* @return the array of HomeNodes
|
||||
*/
|
||||
public Node[] getHomeNodes() {
|
||||
return homeNodes;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method returns the index of the StartNode
|
||||
*
|
||||
* @return the index of the StartNode
|
||||
*/
|
||||
public int getStartNodeIndex() {
|
||||
return startNodeIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method sets the index of the startNode.
|
||||
*
|
||||
* @param startNodeIndex the integer index of the startNode
|
||||
*/
|
||||
public void setStartNodeIndex(int startNodeIndex) {
|
||||
this.startNodeIndex = startNodeIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method returns an array pieces representing the waiting area.
|
||||
*
|
||||
* @return the waiting area
|
||||
*/
|
||||
public Piece[] getWaitingArea() {
|
||||
return waitingArea;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method returns an array of pieces with all the players pieces
|
||||
*
|
||||
* @return the array of pieces
|
||||
*/
|
||||
public Piece[] getPieces() {
|
||||
return pieces;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method adds a piece to the waiting area
|
||||
*
|
||||
* @param piece the piece to be added to the waiting area
|
||||
*/
|
||||
public void addWaitingPiece(Piece piece) {
|
||||
for (int i = 0; i < 4; i++) {
|
||||
if (waitingArea[i] == null) {
|
||||
waitingArea[i] = piece;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This method removes a piece from the waiting area
|
||||
*
|
||||
* @return the piece that was removed from the waiting area
|
||||
*/
|
||||
public Piece removePieceFromWaitingArea() {
|
||||
for (int i = 0; i < 4; i++) {
|
||||
if (waitingArea[i] != null) {
|
||||
Piece piece = waitingArea[i];
|
||||
waitingArea[i] = null;
|
||||
return piece;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package pp.mdga.game;
|
||||
|
||||
public enum ShieldState {
|
||||
NONE,
|
||||
ACTIVE,
|
||||
SUPPRESSED
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package pp.mdga.game;
|
||||
|
||||
public class StartNode extends Node {
|
||||
|
||||
public StartNode() {}
|
||||
|
||||
/**
|
||||
* This method is used to set a new Occupant
|
||||
*
|
||||
* @param occupant the new occupant of the node
|
||||
*/
|
||||
@Override
|
||||
public void setOccupant(Piece occupant) {
|
||||
if (occupant.isShielded()){
|
||||
occupant.setShield(ShieldState.SUPPRESSED);
|
||||
}
|
||||
this.occupant = occupant;
|
||||
}
|
||||
}
|
||||
172
Projekte/mdga/model/src/main/java/pp.mdga/game/Statistic.java
Normal file
172
Projekte/mdga/model/src/main/java/pp.mdga/game/Statistic.java
Normal file
@@ -0,0 +1,172 @@
|
||||
package pp.mdga.game;
|
||||
|
||||
/**
|
||||
* This class will be used to store Statistics during the Game;
|
||||
*/
|
||||
public class Statistic {
|
||||
private int cardsPlayed;
|
||||
private int piecesThrown;
|
||||
private int piecesBeingThrown;
|
||||
private int diced6;
|
||||
private int traveledNodes;
|
||||
private int activatedBonusNodes;
|
||||
|
||||
public Statistic() {
|
||||
cardsPlayed = 0;
|
||||
piecesThrown = 0;
|
||||
piecesBeingThrown = 0;
|
||||
diced6 = 0;
|
||||
traveledNodes = 0;
|
||||
activatedBonusNodes = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method returns the amount of CardsPlayed;
|
||||
*
|
||||
* @return the amount of cardsPlayed as an int
|
||||
*/
|
||||
public int getCardsPlayed() {
|
||||
return cardsPlayed;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method sets the amounts of cardsPlayed
|
||||
*
|
||||
* @param cardsPlayed the new amount of cardsPlayed.
|
||||
*/
|
||||
public void setCardsPlayed(int cardsPlayed) {
|
||||
this.cardsPlayed = cardsPlayed;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method returns the count of enemyPieces Thrown during the game.
|
||||
*
|
||||
* @return the count of enemyPieces thrown
|
||||
*/
|
||||
public int getPiecesThrown() {
|
||||
return piecesThrown;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method sets the new count of enemyPieces Thrown
|
||||
*
|
||||
* @param piecesThrown the new count of pieces thrown.
|
||||
*/
|
||||
public void setPiecesThrown(int piecesThrown) {
|
||||
this.piecesThrown = piecesThrown;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method returns the count of ownPieces Being thrown.
|
||||
*
|
||||
* @return the count of thrown own pieces
|
||||
*/
|
||||
public int getPiecesBeingThrown() {
|
||||
return piecesBeingThrown;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method sets the new count of own pieces thrown.
|
||||
*
|
||||
* @param piecesBeingThrown the new count of thrown own pieces.
|
||||
*/
|
||||
public void setPiecesBeingThrown(int piecesBeingThrown) {
|
||||
this.piecesBeingThrown = piecesBeingThrown;
|
||||
}
|
||||
|
||||
/**
|
||||
* This methode returns the amount of 6s diced during the game.
|
||||
*
|
||||
* @return the amount of 6s diced
|
||||
*/
|
||||
public int getDiced6() {
|
||||
return diced6;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method sets the new amount of 6s diced
|
||||
*
|
||||
* @param diced6 the new amount of 6s diced
|
||||
*/
|
||||
public void setDiced6(int diced6) {
|
||||
this.diced6 = diced6;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method returns the amount of traveled Nodes
|
||||
*
|
||||
* @return the amount of traveled Nodes as int
|
||||
*/
|
||||
public int getTraveledNodes() {
|
||||
return traveledNodes;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method sets the new amount of traveled Nodes.
|
||||
*
|
||||
* @param traveledNodes the new amount of traveled Nodes
|
||||
*/
|
||||
public void setTraveledNodes(int traveledNodes) {
|
||||
this.traveledNodes = traveledNodes;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method returns the amount of activated BonusNodes.
|
||||
*
|
||||
* @return the amount of activated BonusNodes as int
|
||||
*/
|
||||
public int getActivatedBonusNodes() {
|
||||
return activatedBonusNodes;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method sets the new amount of activated BonusNodes
|
||||
*
|
||||
* @param activatedBonusNodes the new amount of activated BonusNodes
|
||||
*/
|
||||
public void setActivatedBonusNodes(int activatedBonusNodes) {
|
||||
this.activatedBonusNodes = activatedBonusNodes;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method increases the value of cardsPlayed by 1.
|
||||
*/
|
||||
public void increaseCardsPlayed() {
|
||||
cardsPlayed++;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method increases the value of cardsPlayed by 1.
|
||||
*/
|
||||
public void increasePiecesThrown() {
|
||||
piecesThrown++;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method increases the value of cardsPlayed by 1.
|
||||
*/
|
||||
public void increasePiecesBeingThrown() {
|
||||
piecesBeingThrown++;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method increases the value of cardsPlayed by 1.
|
||||
*/
|
||||
public void increaseDiced6() {
|
||||
diced6++;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method increases the value of cardsPlayed by 1.
|
||||
*/
|
||||
public void increaseTraveledNodes() {
|
||||
traveledNodes++;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method increases the value of cardsPlayed by 1.
|
||||
*/
|
||||
public void increaseActivatedBonusNodes() {
|
||||
activatedBonusNodes++;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package pp.mdga.message.client;
|
||||
|
||||
public class AnimationEnd extends ClientMessage {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "null";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void accept(ClientInterpreter interpreter, int from) {
|
||||
interpreter.received(this, from);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package pp.mdga.message.client;
|
||||
|
||||
public interface ClientInterpreter {
|
||||
void received(AnimationEnd animationEnd, int from);
|
||||
|
||||
void received(DeselectTSK deselectTSK , int from);
|
||||
|
||||
void received(ForceStartGame forceStartGame, int from);
|
||||
|
||||
void received(JoinServer joinServer , int from);
|
||||
|
||||
void received(LeaveGame leaveGame , int from);
|
||||
|
||||
void received(LobbyNotReady lobbyNotReady , int from);
|
||||
|
||||
void received(LobbyReady lobbyReady , int from);
|
||||
|
||||
void received(RequestBriefing requestBriefing , int from);
|
||||
|
||||
void received(RequestDice requestDice , int from);
|
||||
|
||||
void received(RequestMove requestMove , int from);
|
||||
|
||||
void received(RequestPlayCard requestPlayCard , int from);
|
||||
|
||||
void received(SelectCard selectCard , int from);
|
||||
|
||||
void received(SelectTSK selectTSK , int from);
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package pp.mdga.message.client;
|
||||
|
||||
import com.jme3.network.AbstractMessage;
|
||||
|
||||
public class ClientMessage extends AbstractMessage {
|
||||
protected ClientMessage() {
|
||||
super(true);
|
||||
}
|
||||
public abstract void accept(ClientInterpreter interpreter, int from);
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package pp.mdga.message.client;
|
||||
|
||||
public class DeselectTSK extends ClientMessage {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "null";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void accept(ClientInterpreter interpreter, int from) {
|
||||
interpreter.received(this, from);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package pp.mdga.message.client;
|
||||
|
||||
public class ForceContinueGame extends ClientMessage {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "null";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void accept(ClientInterpreter interpreter, int from) {
|
||||
interpreter.received(this, from);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package pp.mdga.message.client;
|
||||
|
||||
public class ForceStartGame extends ClientMessage {
|
||||
public ForceStartGame() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "null";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void accept(ClientInterpreter interpreter, int from) {
|
||||
interpreter.received(this, from);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package pp.mdga.message.client;
|
||||
|
||||
public class JoinServer extends ClientMessage {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "null";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void accept(ClientInterpreter interpreter, int from) {
|
||||
interpreter.received(this, from);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package pp.mdga.message.client;
|
||||
|
||||
public class LeaveGame extends ClientMessage {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "null";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void accept(ClientInterpreter interpreter, int from) {
|
||||
interpreter.received(this, from);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package pp.mdga.message.client;
|
||||
|
||||
public class LobbyNotReady extends ClientMessage {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "null";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void accept(ClientInterpreter interpreter, int from) {
|
||||
interpreter.received(this, from);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package pp.mdga.message.client;
|
||||
|
||||
public class LobbyReady extends ClientMessage {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "null";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void accept(ClientInterpreter interpreter, int from) {
|
||||
interpreter.received(this, from);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package pp.mdga.message.client;
|
||||
|
||||
public class RequestBriefing extends ClientMessage {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "null";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void accept(ClientInterpreter interpreter, int from) {
|
||||
interpreter.received(this, from);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package pp.mdga.message.client;
|
||||
|
||||
public class RequestDice extends ClientMessage {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "null";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void accept(ClientInterpreter interpreter, int from) {
|
||||
interpreter.received(this, from);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package pp.mdga.message.client;
|
||||
|
||||
public class RequestMove extends ClientMessage {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "null";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void accept(ClientInterpreter interpreter, int from) {
|
||||
interpreter.received(this, from);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package pp.mdga.message.client;
|
||||
|
||||
public class RequestPlayCard extends ClientMessage {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "null";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void accept(ClientInterpreter interpreter, int from) {
|
||||
interpreter.received(this, from);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package pp.mdga.message.client;
|
||||
|
||||
public class SelectCard extends ClientMessage {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "null";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void accept(ClientInterpreter interpreter, int from) {
|
||||
interpreter.received(this, from);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package pp.mdga.message.client;
|
||||
|
||||
public class SelectTSK extends ClientMessage {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "null";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void accept(ClientInterpreter interpreter, int from) {
|
||||
interpreter.received(this, from);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package pp.mdga.message.server;
|
||||
|
||||
public class ActivePlayer extends ServerMessage {
|
||||
@Override
|
||||
public void accept(ServerInterpreter interpreter) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInfoTextKey() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package pp.mdga.message.server;
|
||||
|
||||
public class AnyPiece extends ServerMessage {
|
||||
@Override
|
||||
public void accept(ServerInterpreter interpreter) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInfoTextKey() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package pp.mdga.message.server;
|
||||
|
||||
public class Briefing extends ServerMessage {
|
||||
@Override
|
||||
public void accept(ServerInterpreter interpreter) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInfoTextKey() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package pp.mdga.message.server;
|
||||
|
||||
public class Ceremony extends ServerMessage {
|
||||
@Override
|
||||
public void accept(ServerInterpreter interpreter) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInfoTextKey() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package pp.mdga.message.server;
|
||||
|
||||
public class Dice extends ServerMessage {
|
||||
@Override
|
||||
public void accept(ServerInterpreter interpreter) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInfoTextKey() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package pp.mdga.message.server;
|
||||
|
||||
public class DiceAgain extends ServerMessage {
|
||||
@Override
|
||||
public void accept(ServerInterpreter interpreter) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInfoTextKey() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package pp.mdga.message.server;
|
||||
|
||||
public class DiceNow extends ServerMessage {
|
||||
@Override
|
||||
public void accept(ServerInterpreter interpreter) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInfoTextKey() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package pp.mdga.message.server;
|
||||
|
||||
public class EndOfTurn extends ServerMessage {
|
||||
@Override
|
||||
public void accept(ServerInterpreter interpreter) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInfoTextKey() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package pp.mdga.message.server;
|
||||
|
||||
public class LobbyAccept extends ServerMessage {
|
||||
@Override
|
||||
public void accept(ServerInterpreter interpreter) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInfoTextKey() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package pp.mdga.message.server;
|
||||
|
||||
public class LobbyDeny extends ServerMessage {
|
||||
@Override
|
||||
public void accept(ServerInterpreter interpreter) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInfoTextKey() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package pp.mdga.message.server;
|
||||
|
||||
public class LobbyPlayerJoin extends ServerMessage {
|
||||
@Override
|
||||
public void accept(ServerInterpreter interpreter) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInfoTextKey() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package pp.mdga.message.server;
|
||||
|
||||
public class LobbyPlayerLeave extends ServerMessage {
|
||||
@Override
|
||||
public void accept(ServerInterpreter interpreter) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInfoTextKey() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package pp.mdga.message.server;
|
||||
|
||||
public class MoveMessage extends ServerMessage {
|
||||
@Override
|
||||
public void accept(ServerInterpreter interpreter) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInfoTextKey() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package pp.mdga.message.server;
|
||||
|
||||
public class NoTurn extends ServerMessage {
|
||||
@Override
|
||||
public void accept(ServerInterpreter interpreter) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInfoTextKey() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package pp.mdga.message.server;
|
||||
|
||||
public class PauseGame extends ServerMessage {
|
||||
@Override
|
||||
public void accept(ServerInterpreter interpreter) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInfoTextKey() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package pp.mdga.message.server;
|
||||
|
||||
public class PlayCard extends ServerMessage {
|
||||
@Override
|
||||
public void accept(ServerInterpreter interpreter) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInfoTextKey() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package pp.mdga.message.server;
|
||||
|
||||
public class PossibleCard extends ServerMessage {
|
||||
@Override
|
||||
public void accept(ServerInterpreter interpreter) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInfoTextKey() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package pp.mdga.message.server;
|
||||
|
||||
public class PossiblePiece extends ServerMessage {
|
||||
@Override
|
||||
public void accept(ServerInterpreter interpreter) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInfoTextKey() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package pp.mdga.message.server;
|
||||
|
||||
public class RankingResponce extends ServerMessage {
|
||||
@Override
|
||||
public void accept(ServerInterpreter interpreter) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInfoTextKey() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package pp.mdga.message.server;
|
||||
|
||||
public class RankingRollAgain extends ServerMessage {
|
||||
@Override
|
||||
public void accept(ServerInterpreter interpreter) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInfoTextKey() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package pp.mdga.message.server;
|
||||
|
||||
public class ReconnectBriefing extends ServerMessage {
|
||||
@Override
|
||||
public void accept(ServerInterpreter interpreter) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInfoTextKey() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package pp.mdga.message.server;
|
||||
|
||||
public class ResumeGame extends ServerMessage {
|
||||
@Override
|
||||
public void accept(ServerInterpreter interpreter) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInfoTextKey() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package pp.mdga.message.server;
|
||||
|
||||
public interface ServerInterpreter {
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package pp.mdga.message.server;
|
||||
|
||||
import com.jme3.network.AbstractMessage;
|
||||
|
||||
public abstract class ServerMessage extends AbstractMessage {
|
||||
protected ServerMessage() {
|
||||
super(true);
|
||||
}
|
||||
|
||||
public abstract void accept(ServerInterpreter interpreter);
|
||||
|
||||
public abstract String getInfoTextKey();
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package pp.mdga.message.server;
|
||||
|
||||
public class StartGame extends ServerMessage {
|
||||
@Override
|
||||
public void accept(ServerInterpreter interpreter) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInfoTextKey() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package pp.mdga.message.server;
|
||||
|
||||
public class StartPiece extends ServerMessage {
|
||||
@Override
|
||||
public void accept(ServerInterpreter interpreter) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInfoTextKey() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package pp.mdga.message.server;
|
||||
|
||||
public class UpdateReady extends ServerMessage {
|
||||
@Override
|
||||
public void accept(ServerInterpreter interpreter) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInfoTextKey() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package pp.mdga.message.server;
|
||||
|
||||
public class UpdateTSK extends ServerMessage {
|
||||
@Override
|
||||
public void accept(ServerInterpreter interpreter) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInfoTextKey() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package pp.mdga.message.server;
|
||||
|
||||
public class WaitPiece extends ServerMessage {
|
||||
@Override
|
||||
public void accept(ServerInterpreter interpreter) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInfoTextKey() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package pp.mdga.server;
|
||||
|
||||
public class Ceremony extends ServerState {
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package pp.mdga.server;
|
||||
|
||||
public class ChoosePiece extends Turn {
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package pp.mdga.server;
|
||||
|
||||
public class DetermineStartPlayer extends Game {
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package pp.mdga.server;
|
||||
|
||||
public class Dialogs extends ServerState {
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package pp.mdga.server;
|
||||
|
||||
public class FirstRoll extends RollDice {
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package pp.mdga.server;
|
||||
|
||||
public class Game extends ServerState {
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package pp.mdga.server;
|
||||
|
||||
public class Interrupt extends ServerState {
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package pp.mdga.server;
|
||||
|
||||
public class MovePiece extends Turn {
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user