rename packages lower case
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
package client;
|
||||
|
||||
import Server.*;
|
||||
import Server.Automaton.ActionResult;
|
||||
import Server.Automaton.Game;
|
||||
import Server.Cards.*;
|
||||
import server.*;
|
||||
import server.*;
|
||||
import server.automaton.ActionResult;
|
||||
import server.automaton.Game;
|
||||
import server.cards.*;
|
||||
import javafx.animation.*;
|
||||
import javafx.application.Application;
|
||||
import javafx.application.Platform;
|
||||
@@ -29,6 +30,10 @@ import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.pdfbox.pdmodel.PDDocument;
|
||||
import org.apache.pdfbox.rendering.PDFRenderer;
|
||||
import server.cards.BuildingCard;
|
||||
import server.cards.Card;
|
||||
import server.cards.CharacterCard;
|
||||
import server.cards.CharacterType;
|
||||
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.IOException;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package client;
|
||||
|
||||
import Server.Automaton.Game;
|
||||
import Server.Player;
|
||||
import Server.TotemColor;
|
||||
import server.automaton.Game;
|
||||
import server.Player;
|
||||
import server.TotemColor;
|
||||
import javafx.application.Application;
|
||||
import javafx.embed.swing.SwingFXUtils;
|
||||
import javafx.geometry.Insets;
|
||||
|
||||
@@ -8,12 +8,12 @@ module org.example.mesosll07 {
|
||||
requires org.apache.logging.log4j;
|
||||
|
||||
opens org.example.mesosll07 to javafx.fxml;
|
||||
exports Server;
|
||||
opens Server to javafx.fxml;
|
||||
exports Server.Cards;
|
||||
opens Server.Cards to javafx.fxml;
|
||||
exports Server.Automaton;
|
||||
opens Server.Automaton to javafx.fxml;
|
||||
exports server;
|
||||
opens server to javafx.fxml;
|
||||
exports server.cards;
|
||||
opens server.cards to javafx.fxml;
|
||||
exports server.automaton;
|
||||
opens server.automaton to javafx.fxml;
|
||||
exports client;
|
||||
opens client to javafx.fxml;
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
package Server;
|
||||
package server;
|
||||
|
||||
import Server.Cards.BuildingCard;
|
||||
import Server.Cards.CharacterCard;
|
||||
import Server.Cards.CharacterType;
|
||||
import Server.Cards.Trigger;
|
||||
import Server.Utils.EventsManagerException;
|
||||
import server.cards.BuildingCard;
|
||||
import server.cards.CharacterCard;
|
||||
import server.cards.CharacterType;
|
||||
import server.cards.Trigger;
|
||||
import server.utils.EventsManagerException;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -1,4 +1,4 @@
|
||||
package Server;
|
||||
package server;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package Server;
|
||||
package server;
|
||||
|
||||
public enum Era {
|
||||
I,
|
||||
@@ -1,9 +1,8 @@
|
||||
package Server;
|
||||
package server;
|
||||
|
||||
import Server.Cards.Event;
|
||||
import Server.Cards.EventCard;
|
||||
import Server.Cards.Trigger;
|
||||
import Server.Utils.EventsManagerException;
|
||||
import server.cards.Event;
|
||||
import server.cards.EventCard;
|
||||
import server.utils.EventsManagerException;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -1,12 +1,11 @@
|
||||
package Server;
|
||||
package server;
|
||||
|
||||
import Server.Automaton.Game;
|
||||
import Server.Cards.*;
|
||||
import server.cards.*;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import server.cards.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
@@ -35,7 +34,7 @@ public class GameBoard {
|
||||
|
||||
private Era era;
|
||||
|
||||
private final CardDeck cardDeck;
|
||||
private final CardDeck cardDeck;
|
||||
private final List<Card> topRow;
|
||||
private final List<Card> bottomRow;
|
||||
private final List<OfferingTile> offeringTiles;
|
||||
@@ -1,4 +1,4 @@
|
||||
package Server;
|
||||
package server;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
@@ -1,6 +1,6 @@
|
||||
package Server;
|
||||
package server;
|
||||
|
||||
import Server.Cards.CharacterCard;
|
||||
import server.cards.CharacterCard;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package Server;
|
||||
package server;
|
||||
|
||||
public enum Symbol {
|
||||
UP,
|
||||
@@ -1,4 +1,4 @@
|
||||
package Server;
|
||||
package server;
|
||||
|
||||
import javafx.scene.paint.Color;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package Server;
|
||||
package server;
|
||||
|
||||
import Server.Cards.BuildingCard;
|
||||
import Server.Cards.CharacterCard;
|
||||
import Server.Cards.CharacterType;
|
||||
import Server.Cards.Trigger;
|
||||
import server.cards.BuildingCard;
|
||||
import server.cards.CharacterCard;
|
||||
import server.cards.CharacterType;
|
||||
import server.cards.Trigger;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -1,4 +1,4 @@
|
||||
package Server;
|
||||
package server;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
@@ -42,10 +42,10 @@ public class TurnTile {
|
||||
/**
|
||||
* Randomises the initial turn order. Call once during game setup.
|
||||
*/
|
||||
public void setInitialOrder(List<Player> players) {
|
||||
public void setInitialOrder(List<Player> players, boolean random) {
|
||||
|
||||
List<Player> shuffled = new ArrayList<>(players);
|
||||
Collections.shuffle(shuffled);
|
||||
if (random) Collections.shuffle(shuffled);
|
||||
for (int i = 0; i < shuffled.size(); i++) {
|
||||
positions[i] = shuffled.get(i);
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package Server;
|
||||
package server;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
@@ -1,4 +1,4 @@
|
||||
package Server.Automaton;
|
||||
package server.automaton;
|
||||
|
||||
public class ActionResult {
|
||||
private final boolean success;
|
||||
@@ -1,4 +1,4 @@
|
||||
package Server.Automaton;
|
||||
package server.automaton;
|
||||
|
||||
public class Automaton {
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
package Server.Automaton;
|
||||
package server.automaton;
|
||||
|
||||
import Server.*;
|
||||
import Server.Cards.*;
|
||||
import Server.Utils.LoadingCardsException;
|
||||
import server.*;
|
||||
import server.cards.*;
|
||||
import server.*;
|
||||
import server.cards.*;
|
||||
import server.utils.LoadingCardsException;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
@@ -48,7 +50,7 @@ public class Game {
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
private final List<Player> players;
|
||||
private GameBoard gameBoard;
|
||||
private GameBoard gameBoard;
|
||||
private int round;
|
||||
private GameState state;
|
||||
|
||||
@@ -106,7 +108,7 @@ public class Game {
|
||||
gameBoard.initOfferingTiles(players.size());
|
||||
gameBoard.setupInitialRows(players.size());
|
||||
|
||||
gameBoard.getTurnTile().setInitialOrder(players);
|
||||
gameBoard.getTurnTile().setInitialOrder(players, true);
|
||||
dealInitialFood();
|
||||
|
||||
round = 1;
|
||||
@@ -255,7 +257,7 @@ public class Game {
|
||||
*/
|
||||
private void filterImpossibleActions(Player player) {
|
||||
|
||||
Card ctop = gameBoard.getTopRow().stream().filter(s -> s instanceof CharacterCard || s instanceof BuildingCard).findFirst().orElse(null);
|
||||
Card ctop = gameBoard.getTopRow().stream().filter(s -> s instanceof CharacterCard || s instanceof BuildingCard).findFirst().orElse(null);
|
||||
Card cdown = gameBoard.getBottomRow().stream().filter(s -> s instanceof CharacterCard || s instanceof BuildingCard).findFirst().orElse(null);
|
||||
|
||||
boolean topEmpty = ctop == null;
|
||||
@@ -1,4 +1,4 @@
|
||||
package Server.Automaton;
|
||||
package server.automaton;
|
||||
|
||||
public enum GameState implements Comparable<GameState> {
|
||||
UNKNOWN,
|
||||
@@ -1,7 +1,7 @@
|
||||
package Server.Cards;
|
||||
package server.cards;
|
||||
|
||||
import Server.Era;
|
||||
import Server.Player;
|
||||
import server.Era;
|
||||
import server.Player;
|
||||
|
||||
public class BuildingCard extends Card{
|
||||
private final int cost;
|
||||
@@ -1,6 +1,6 @@
|
||||
package Server.Cards;
|
||||
package server.cards;
|
||||
|
||||
import Server.Era;
|
||||
import server.Era;
|
||||
|
||||
public abstract class Card {
|
||||
private final int cardId;
|
||||
@@ -1,8 +1,7 @@
|
||||
package Server.Cards;
|
||||
package server.cards;
|
||||
|
||||
import Server.Automaton.Game;
|
||||
import Server.Era;
|
||||
import Server.Utils.LoadingCardsException;
|
||||
import server.Era;
|
||||
import server.utils.LoadingCardsException;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package Server.Cards;
|
||||
package server.cards;
|
||||
|
||||
import Server.Era;
|
||||
import Server.Utils.LoadingCardsException;
|
||||
import server.Era;
|
||||
import server.utils.LoadingCardsException;
|
||||
|
||||
public class CharacterCard extends Card{
|
||||
private final CharacterType characterType;
|
||||
@@ -1,4 +1,4 @@
|
||||
package Server.Cards;
|
||||
package server.cards;
|
||||
|
||||
public enum CharacterType {
|
||||
INVENTOR,
|
||||
@@ -1,4 +1,4 @@
|
||||
package Server.Cards;
|
||||
package server.cards;
|
||||
|
||||
public enum Event {
|
||||
SUSTAINMENT,
|
||||
@@ -1,7 +1,7 @@
|
||||
package Server.Cards;
|
||||
package server.cards;
|
||||
|
||||
import Server.Era;
|
||||
import Server.Utils.LoadingCardsException;
|
||||
import server.Era;
|
||||
import server.utils.LoadingCardsException;
|
||||
|
||||
public class EventCard extends Card {
|
||||
private final Event event;
|
||||
@@ -1,4 +1,4 @@
|
||||
package Server.Cards;
|
||||
package server.cards;
|
||||
|
||||
public enum Trigger {
|
||||
FOOD_FOR_SIX,
|
||||
@@ -1,4 +1,4 @@
|
||||
package Server.Utils;
|
||||
package server.utils;
|
||||
|
||||
public class EventsManagerException extends RuntimeException {
|
||||
public EventsManagerException(String message) {
|
||||
@@ -1,4 +1,4 @@
|
||||
package Server.Utils;
|
||||
package server.utils;
|
||||
|
||||
public class GameException extends RuntimeException {
|
||||
public GameException(String message) {
|
||||
@@ -1,4 +1,4 @@
|
||||
package Server.Utils;
|
||||
package server.utils;
|
||||
|
||||
public class LoadingCardsException extends RuntimeException {
|
||||
public LoadingCardsException(String message) {
|
||||
@@ -1,10 +1,8 @@
|
||||
package Server;
|
||||
package server;
|
||||
|
||||
import Server.Cards.BuildingCard;
|
||||
|
||||
import Server.Cards.CardDeck;
|
||||
import Server.Cards.CharacterCard;
|
||||
import Server.Cards.EventCard;
|
||||
import server.cards.CardDeck;
|
||||
import server.cards.CharacterCard;
|
||||
import server.cards.EventCard;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package Server;
|
||||
package server;
|
||||
|
||||
import Server.Cards.Card;
|
||||
import Server.Cards.CardDeck;
|
||||
import Server.Cards.CharacterCard;
|
||||
import Server.Cards.EventCard;
|
||||
import Server.Utils.EventsManagerException;
|
||||
import server.cards.Card;
|
||||
import server.cards.CardDeck;
|
||||
import server.cards.CharacterCard;
|
||||
import server.cards.EventCard;
|
||||
import server.utils.EventsManagerException;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package Server;
|
||||
package server;
|
||||
|
||||
import Server.Cards.*;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import server.*;
|
||||
import server.cards.CardDeck;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package Server;
|
||||
package server;
|
||||
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -1,4 +1,4 @@
|
||||
package Server;
|
||||
package server;
|
||||
|
||||
import org.junit.jupiter.api.DisplayName;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -1,13 +1,11 @@
|
||||
package Server;
|
||||
package server;
|
||||
|
||||
import Server.Cards.BuildingCard;
|
||||
import Server.Cards.CharacterCard;
|
||||
import Server.Cards.CharacterType;
|
||||
import Server.Cards.Trigger;
|
||||
import Server.Era;
|
||||
import server.cards.BuildingCard;
|
||||
import server.cards.CharacterCard;
|
||||
import server.cards.CharacterType;
|
||||
import server.cards.Trigger;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package Server;
|
||||
package server;
|
||||
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -1,4 +1,4 @@
|
||||
package Server;
|
||||
package server;
|
||||
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -19,7 +19,6 @@ class TurnTileTest {
|
||||
List<Player> players = new ArrayList<>();
|
||||
@BeforeEach
|
||||
public void setUp(){
|
||||
|
||||
players.add(player1);
|
||||
players.add(player2);
|
||||
players.add(player3);
|
||||
@@ -27,38 +26,27 @@ class TurnTileTest {
|
||||
players.add(player5);
|
||||
turnTile = new TurnTile(5);
|
||||
}
|
||||
/**
|
||||
|
||||
@Test
|
||||
void startOrder() {
|
||||
assertEquals(5, turnTileOld.startOrder(players).length);
|
||||
turnTile.setInitialOrder(players, false);
|
||||
assertEquals(player1, turnTile.nextToPlace());
|
||||
assertEquals(player2, turnTile.nextToPlace());
|
||||
assertEquals(player3, turnTile.nextToPlace());
|
||||
assertEquals(player4, turnTile.nextToPlace());
|
||||
assertEquals(player5, turnTile.nextToPlace());
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
void giveReward() {
|
||||
turnTileOld.startOrder(players);
|
||||
turnTile.setInitialOrder(players, false);
|
||||
player5.addFood(1);
|
||||
assertEquals(0, turnTileOld.giveReward(player5).getFoodTokens());
|
||||
|
||||
System.out.println(player5);
|
||||
turnTile.returnTotem(player5);
|
||||
System.out.println(player5);
|
||||
assertEquals(0, player5.getFoodTokens());
|
||||
}
|
||||
|
||||
@Test
|
||||
void nextPlayer() {
|
||||
|
||||
//test that the method proceeds along the array
|
||||
turnTileOld.startOrder(players);
|
||||
assertEquals(player2, turnTileOld.nextPlayer());
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
void addPlayer() {
|
||||
|
||||
//verify that the first player changes
|
||||
|
||||
turnTileOld.startOrder(players);
|
||||
assertEquals(player2, turnTileOld.addPlayer(player2));
|
||||
}
|
||||
**/
|
||||
|
||||
}
|
||||
@@ -1,9 +1,7 @@
|
||||
package Server.Automaton;
|
||||
package server.automaton;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
class GameTest {
|
||||
|
||||
@Test
|
||||
@@ -1,9 +1,9 @@
|
||||
package Server.Cards;
|
||||
package server.cards;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static Server.Era.I;
|
||||
import static Server.Era.II;
|
||||
import static server.Era.I;
|
||||
import static server.Era.II;
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
class BuildingCardTest {
|
||||
@@ -1,9 +1,10 @@
|
||||
package Server.Cards;
|
||||
package server.cards;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.util.List;
|
||||
import Server.Era;
|
||||
|
||||
import server.Era;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
class CardDeckTest {
|
||||
@@ -1,9 +1,9 @@
|
||||
package Server.Cards;
|
||||
package server.cards;
|
||||
|
||||
import Server.Utils.LoadingCardsException;
|
||||
import server.utils.LoadingCardsException;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static Server.Era.I;
|
||||
import static server.Era.I;
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
class CharacterCardTest {
|
||||
@@ -1,9 +1,9 @@
|
||||
package Server.Cards;
|
||||
package server.cards;
|
||||
|
||||
import Server.Utils.LoadingCardsException;
|
||||
import server.utils.LoadingCardsException;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static Server.Era.I;
|
||||
import static server.Era.I;
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
class EventCardTest {
|
||||
Reference in New Issue
Block a user