Package it.polimi.ingsw.view.socket
Class Parser
- java.lang.Object
-
- it.polimi.ingsw.utils.Observable<ArrayList<Command>>
-
- it.polimi.ingsw.view.socket.Parser
-
-
Constructor Summary
Constructors Constructor Description Parser()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Cell[][]
getBoard()
Get Game BoardList<Command>
getCommandList(String filter)
Get an arraylist of command of a certain typeString
getCurrentPlayer()
Get current player usernameList<String>
getFilters()
Get Current available Type CommandString
getGamePhase()
Get game phaseList<Player>
getPlayers()
Get Player InfoList<Command>
getUsableCommandList()
Get all player available commandstatic String
toString(Command command)
Convert a Command into a String to send to the servervoid
update(String commandList)
Observer Update Function-
Methods inherited from class it.polimi.ingsw.utils.Observable
addObservers, addObservers, notify, notify
-
-
-
-
Method Detail
-
update
public void update(String commandList)
Description copied from interface:Observer
Observer Update Function
-
getFilters
public List<String> getFilters()
Get Current available Type Command- Returns:
- an array list of string of actual filter available (type of command)
-
getCommandList
public List<Command> getCommandList(String filter)
Get an arraylist of command of a certain type- Parameters:
filter
- a string to filter commands (type field)- Returns:
- array list with filtered command (type field)
-
getUsableCommandList
public List<Command> getUsableCommandList()
Get all player available command- Returns:
- array list of all commands usable from users
-
toString
public static String toString(Command command)
Convert a Command into a String to send to the server- Parameters:
command
- to parse into string- Returns:
- command parsed into string
-
getBoard
public Cell[][] getBoard()
Get Game Board- Returns:
- Game Board
-
getCurrentPlayer
public String getCurrentPlayer()
Get current player username- Returns:
- current player username
-
getGamePhase
public String getGamePhase()
Get game phase- Returns:
- game phase
-
-