Removed: Observer
This commit is contained in:
@@ -1,10 +1,8 @@
|
|||||||
package it.polimi.ingsw.gc14.Controller;
|
package it.polimi.ingsw.gc14.Controller;
|
||||||
|
|
||||||
import it.polimi.ingsw.gc14.Model.Game;
|
import it.polimi.ingsw.gc14.Model.Game;
|
||||||
import it.polimi.ingsw.gc14.Model.Player;
|
|
||||||
import it.polimi.ingsw.gc14.Network.IClient;
|
import it.polimi.ingsw.gc14.Network.IClient;
|
||||||
import it.polimi.ingsw.gc14.Network.NetworkEvents.*;
|
import it.polimi.ingsw.gc14.Network.NetworkEvents.*;
|
||||||
import it.polimi.ingsw.gc14.Network.Observer;
|
|
||||||
import it.polimi.ingsw.gc14.View.IView;
|
import it.polimi.ingsw.gc14.View.IView;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ import java.util.*;
|
|||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
import it.polimi.ingsw.gc14.Network.Observer;
|
|
||||||
import it.polimi.ingsw.gc14.View.TUI.AsciiTable;
|
import it.polimi.ingsw.gc14.View.TUI.AsciiTable;
|
||||||
import it.polimi.ingsw.gc14.View.TUI.BorderStyle;
|
import it.polimi.ingsw.gc14.View.TUI.BorderStyle;
|
||||||
|
|
||||||
@@ -33,18 +32,6 @@ import it.polimi.ingsw.gc14.View.TUI.BorderStyle;
|
|||||||
*/
|
*/
|
||||||
public class Game implements Serializable {
|
public class Game implements Serializable {
|
||||||
|
|
||||||
private transient List<Observer> observers = new ArrayList<>(); // transient! non serializzare
|
|
||||||
|
|
||||||
public void addObserver(Observer observer) {
|
|
||||||
observers.add(observer);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void notifyObservers() {
|
|
||||||
for (Observer o : observers) {
|
|
||||||
o.update(this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the list of players participating in the game.
|
* Returns the list of players participating in the game.
|
||||||
* @return
|
* @return
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
package it.polimi.ingsw.gc14.Network;
|
|
||||||
|
|
||||||
import it.polimi.ingsw.gc14.Model.Game;
|
|
||||||
|
|
||||||
public interface Observer {
|
|
||||||
public void update(Game model);
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user