Class Parser

    • Constructor Detail

      • Parser

        public Parser()
    • Method Detail

      • update

        public void update​(String commandList)
        Description copied from interface: Observer
        Observer Update Function
        Specified by:
        update in interface Observer<String>
        Parameters:
        commandList - message received
      • 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
      • getPlayers

        public List<Player> getPlayers()
        Get Player Info
        Returns:
        Arraylist of Player Info
      • getCurrentPlayer

        public String getCurrentPlayer()
        Get current player username
        Returns:
        current player username
      • getGamePhase

        public String getGamePhase()
        Get game phase
        Returns:
        game phase