Class ViewTUIPrintUtils

java.lang.Object
it.polimi.ingsw.am13.client.view.tui.ViewTUIPrintUtils

public class ViewTUIPrintUtils extends Object
Class containing various utility methods used by view TUI to print elements on the terminal
  • Constructor Details

    • ViewTUIPrintUtils

      public ViewTUIPrintUtils()
  • Method Details

    • createCounterLines

      public static List<String> createCounterLines(Map<Resource,Integer> resourcesInField)
      Creates the 7 lines that can be used as counter in TUI. There is 1 line per resource, and the symbols used are the same ones printed on the field
      Parameters:
      resourcesInField - Count of resources currently on the field
      Returns:
      List of size 7 of string lines for the counter. Each line is long 6 chars
    • printStartup

      public static void printStartup(boolean isSocket, String ip, int port)
    • starterCards

      public static String starterCards(CardPlayableIF cardStarter)
    • createInfoForObjective

      public static List<String> createInfoForObjective(CardObjectiveIF obj)
    • objectiveCards

      public static String objectiveCards(CardObjectiveIF obj1, CardObjectiveIF obj2)
      Create the string associated to the two objective cards the player can choose from
      Parameters:
      obj1 - first objective card
      obj2 - second objective card
      Returns:
      the string associated to those objective cards
    • genFieldString

      public static String genFieldString(FieldState field)
      Generate the field string
      Parameters:
      field - of a player
      Returns:
      the string representing the field
    • cardToStr

      private static List<List<Character>> cardToStr(CardSidePlayableIF cardSidePlayableIF)
    • availableStr

      private static List<List<Character>> availableStr(int index)
    • putCardStrInFieldStr

      private static void putCardStrInFieldStr(Character[][] fieldMatrix, List<List<Character>> strCard, int curX, int curY)