Merge branch 'RMI' into main
This commit is contained in:
@@ -5,11 +5,10 @@ import it.polimi.ingsw.gc14.Model.Cards.Building.EffectType;
|
||||
import it.polimi.ingsw.gc14.Model.PlayableCard;
|
||||
import it.polimi.ingsw.gc14.Model.Player;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class BuildingCard extends PlayableCard implements Cloneable , BuildingEffect {
|
||||
|
||||
/**
|
||||
public class BuildingCard extends PlayableCard implements Cloneable , BuildingEffect, Serializable {
|
||||
/**
|
||||
* The price of this building card.
|
||||
*/
|
||||
private int price;
|
||||
@@ -78,7 +77,7 @@ public class BuildingCard extends PlayableCard implements Cloneable , BuildingEf
|
||||
* @param prestigeValue the prestige value of the building card.
|
||||
* @throws IllegalArgumentException if {@code price <= 0} or {@code prestigeValue < 0}
|
||||
*/
|
||||
public BuildingCard(int era,int price,int prestigeValue) throws IllegalArgumentException{
|
||||
protected BuildingCard(int era,int price,int prestigeValue) throws IllegalArgumentException{
|
||||
super(era);
|
||||
if (price > 0) {
|
||||
this.price = price;
|
||||
|
||||
@@ -2,13 +2,15 @@ package it.polimi.ingsw.gc14.Model.Cards;
|
||||
|
||||
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.Character;
|
||||
import it.polimi.ingsw.gc14.Model.PlayableCard;
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* Abstract base class for all tribe cards.
|
||||
* A TribeCard is a {@link PlayableCard} that may either be an event card
|
||||
* or a non-event card, and may optionally specify a minimum number of players.
|
||||
*/
|
||||
public abstract class TribeCard extends PlayableCard {
|
||||
public abstract class TribeCard extends PlayableCard implements Serializable {
|
||||
|
||||
/**
|
||||
* Indicates whether this tribe card is an event card.
|
||||
|
||||
@@ -8,13 +8,14 @@ import it.polimi.ingsw.gc14.Model.Cards.TribeCards.Events.Sustenance;
|
||||
import it.polimi.ingsw.gc14.Model.DecksCreator;
|
||||
import it.polimi.ingsw.gc14.Model.Slot;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* Board manages all the elements during the game such as decks, upper and lower rows, totems, tiles...
|
||||
*/
|
||||
public class Board {
|
||||
public class Board implements Serializable {
|
||||
/**
|
||||
* slotList contains the ordered list of slots (tiles). The slots changes based on the number of players.
|
||||
* Each slot (tile) has special action as drawing from the upper/lower row or taking food.
|
||||
|
||||
@@ -3,13 +3,14 @@ package it.polimi.ingsw.gc14.Model.GamePackage;
|
||||
import it.polimi.ingsw.gc14.Model.Player;
|
||||
import it.polimi.ingsw.gc14.Model.Slot;
|
||||
import it.polimi.ingsw.gc14.Model.GamePackage.GameStages;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* Represents the current state of the game.
|
||||
* A CurrentState object stores the current player, slot, era, round,
|
||||
* remaining upper and lower cards, and the current game stage.
|
||||
*/
|
||||
public class CurrentState {
|
||||
public class CurrentState implements Serializable {
|
||||
// region Getters
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,6 +2,7 @@ package it.polimi.ingsw.gc14.Model;
|
||||
|
||||
import it.polimi.ingsw.gc14.Model.Cards.BuildingCard;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
@@ -9,7 +10,7 @@ import java.util.*;
|
||||
* An OrderLogicCard manages a queue of players and defines the effects
|
||||
* applied when players are pushed back into the queue.
|
||||
*/
|
||||
public abstract class OrderLogicCard {
|
||||
public abstract class OrderLogicCard implements Serializable {
|
||||
|
||||
/**
|
||||
* The queue of players associated with this order logic card.
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
package it.polimi.ingsw.gc14.Model;
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* Abstract base class for all playable cards.
|
||||
* A PlayableCard is characterized by an era value.
|
||||
*/
|
||||
public abstract class PlayableCard {
|
||||
public abstract class PlayableCard implements Serializable {
|
||||
|
||||
/**
|
||||
* The era associated with this playable card.
|
||||
|
||||
@@ -4,13 +4,14 @@ import it.polimi.ingsw.gc14.Model.Cards.BuildingCard;
|
||||
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.CharacterType;
|
||||
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.Characters.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* Default Player class; contains all identifiers and methods needed.
|
||||
*/
|
||||
public class Player {
|
||||
public class Player implements Serializable {
|
||||
/**
|
||||
* The maximum length allowed for the username string.
|
||||
*/
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
package it.polimi.ingsw.gc14.Model;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* Represents a slot with a specific identifier and associated values
|
||||
* for upper cards, lower cards, food, and minimum number of players.
|
||||
* The slot configuration depends on the specified slot identifier.
|
||||
*/
|
||||
public class Slot {
|
||||
public class Slot implements Serializable {
|
||||
// Getters
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user