Bind: TUI->Launcher
This commit is contained in:
@@ -1,18 +1,31 @@
|
||||
package it.polimi.ingsw.gc14.View.TUI;
|
||||
import it.polimi.ingsw.gc14.Model.Game;
|
||||
import it.polimi.ingsw.gc14.Network.Observer;
|
||||
import it.polimi.ingsw.gc14.View.IView;
|
||||
|
||||
public class TUI implements IView {
|
||||
public class TUI implements IView, Observer {
|
||||
|
||||
// ── dati di stato ───────────────────────────────────────────
|
||||
private BorderStyle style = BorderStyle.UNICODE;
|
||||
private Game model;
|
||||
private String username;
|
||||
public TUI(Game model) {
|
||||
this.model = model;
|
||||
this.username="";
|
||||
}
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(Game model) {
|
||||
this.model = model;
|
||||
}
|
||||
|
||||
// ── punto di ingresso ───────────────────────────────────────
|
||||
public void render(Game model)
|
||||
public void render()
|
||||
{
|
||||
this.model=model;
|
||||
try{
|
||||
String os = System.getProperty("os.name").toLowerCase();
|
||||
ProcessBuilder pb;
|
||||
@@ -28,7 +41,7 @@ public class TUI implements IView {
|
||||
System.out.println(model.toString());
|
||||
}
|
||||
|
||||
public void renderBoard(Game model)
|
||||
public void renderBoard()
|
||||
{
|
||||
try{
|
||||
String os = System.getProperty("os.name").toLowerCase();
|
||||
@@ -44,7 +57,7 @@ public class TUI implements IView {
|
||||
}
|
||||
System.out.println(model.BoardStamp());
|
||||
}
|
||||
public void renderPlayer(Game model)
|
||||
public void renderPlayer()
|
||||
{
|
||||
try{
|
||||
String os = System.getProperty("os.name").toLowerCase();
|
||||
@@ -60,7 +73,7 @@ public class TUI implements IView {
|
||||
}
|
||||
System.out.println(model.BoardStamp());
|
||||
}
|
||||
public void renderMyHand(Game model,String username)
|
||||
public void renderMyHand()
|
||||
{
|
||||
try{
|
||||
String os = System.getProperty("os.name").toLowerCase();
|
||||
@@ -76,6 +89,7 @@ public class TUI implements IView {
|
||||
}
|
||||
System.out.println(model.getPlayerByUsername(username));
|
||||
}
|
||||
|
||||
|
||||
public void showMessage(String message)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user