Class CLIMap

java.lang.Object
fr.formiko.views.cli.CLIMap

public class CLIMap extends Object
Represent the Map in CLI mode.
CLI = Console Line Interface.
Author:
Hydrolien
  • Field Details

    • gc

      private GCase gc
    • legend

      private static fr.formiko.usual.structures.listes.GString legend
    • xi

      private static int xi
    • unseeableChar

      private static int unseeableChar
    • sizeCase

      private int sizeCase
    • lookedCCase

      private CCase lookedCCase
  • Constructor Details

    • CLIMap

      public CLIMap(GCase gc)
      Main contructor.
      Parameters:
      gc - The GCase to print.
  • Method Details

    • getLookedCCase

      public CCase getLookedCCase()
    • setLookedCCase

      public void setLookedCCase(CCase cc)
    • toString

      public String toString()
      Main function of CLIMap.
      If on linux it will use color for the map.
      Overrides:
      toString in class Object
      Returns:
      Printable String that represent GString.
    • getColorAllyStatus

      private static String getColorAllyStatus(Creature c)
      Return a color String to represent the ally status of Creature c with the playingAnt.
    • objetSurCarteAIdToString

      public static String objetSurCarteAIdToString(ObjetSurCarteAId o, boolean colored)
      Return a String representing the ObjetSurCarteAId in param.
      Parameters:
      o - The Object to represent.
    • objetSurCarteAIdToString

      public static String objetSurCarteAIdToString(ObjetSurCarteAId o)
    • legendToString

      private String legendToString()
      Return the legend as a String.
      Legend can be empty or can have line that look like this "A : F1, 5, G12 \n B : 8, 3 etc."
    • mapToMapString

      public String mapToMapString()
      Return the map as a String easy to use.
    • mapToString

      public String mapToString()
      Return the map as a String.
      All map infos are stored in a GCase, this.gc.
    • mapLineToString

      public String mapLineToString(CCase cc, Joueur j)
      Return a line of a map as a String.
      Parameters:
      cc - The 1a CCase of the line.
    • caseToString

      public String caseToString(CCase cc, Joueur j)
      Return a case as a String.
      This string have a fix length.
      Parameters:
      cc - CCase that contain Case to print.
      j - Player that will be used to know if cases need to be nuageuse or sombre.
    • caseToString

      public String caseToString(Case contenu, boolean caseNuageuse, boolean caseSombre)
      Return a Case as a String.
      This string have a fix length.
      Parameters:
      contenu - Case to print.
      caseNuageuse - Boolean to know if player have explored the Case.
      caseSombre - Boolean to know if player is curently seeing the Case.
    • caseColor

      public String caseColor(Case c)
      Return the backgroud color of a Case.
      Parameters:
      c - Case to print.