Add: RMI
This commit is contained in:
@@ -5,9 +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 {
|
||||
private int price;
|
||||
public int getPrice() {
|
||||
return price;
|
||||
@@ -26,7 +27,7 @@ public class BuildingCard extends PlayableCard implements Cloneable , BuildingEf
|
||||
return effectType;
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
@@ -3,7 +3,9 @@ package it.polimi.ingsw.gc14.Model.Cards;
|
||||
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.Character;
|
||||
import it.polimi.ingsw.gc14.Model.PlayableCard;
|
||||
|
||||
public abstract class TribeCard extends PlayableCard {
|
||||
import java.io.Serializable;
|
||||
|
||||
public abstract class TribeCard extends PlayableCard implements Serializable {
|
||||
private boolean isEventCard;
|
||||
public boolean IsEventCard() {
|
||||
return isEventCard;
|
||||
|
||||
@@ -14,10 +14,11 @@ import it.polimi.ingsw.gc14.Model.Orders.Order4;
|
||||
import it.polimi.ingsw.gc14.Model.Orders.Order5;
|
||||
import it.polimi.ingsw.gc14.Model.GamePackage.GameStages;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class Game {
|
||||
public class Game implements Serializable {
|
||||
|
||||
private ArrayList<Player> playersList;
|
||||
private CurrentState currentState;
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -4,7 +4,9 @@ import it.polimi.ingsw.gc14.Model.Player;
|
||||
import it.polimi.ingsw.gc14.Model.Slot;
|
||||
import it.polimi.ingsw.gc14.Model.GamePackage.GameStages;
|
||||
|
||||
public class CurrentState {
|
||||
import java.io.Serializable;
|
||||
|
||||
public class CurrentState implements Serializable {
|
||||
// region Getters
|
||||
private Player player;
|
||||
public Player getCurrentPlayer(){
|
||||
|
||||
@@ -2,9 +2,10 @@ package it.polimi.ingsw.gc14.Model;
|
||||
|
||||
import it.polimi.ingsw.gc14.Model.Cards.BuildingCard;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.*;
|
||||
|
||||
public abstract class OrderLogicCard {
|
||||
public abstract class OrderLogicCard implements Serializable {
|
||||
private Queue<Player> players;
|
||||
public OrderLogicCard(ArrayList<Player> players) {
|
||||
Collections.shuffle(players);
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package it.polimi.ingsw.gc14.Model;
|
||||
|
||||
public abstract class PlayableCard {
|
||||
import java.io.Serializable;
|
||||
|
||||
public abstract class PlayableCard implements Serializable {
|
||||
private int Era;
|
||||
public int getEra(){
|
||||
return Era;
|
||||
|
||||
@@ -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,6 +1,8 @@
|
||||
package it.polimi.ingsw.gc14.Model;
|
||||
|
||||
public class Slot {
|
||||
import java.io.Serializable;
|
||||
|
||||
public class Slot implements Serializable {
|
||||
// Getters
|
||||
private char slotId;
|
||||
public char getSlotId() {
|
||||
|
||||
Reference in New Issue
Block a user