Class CLIGridPosition

java.lang.Object
polimi.ingsw.am21.codex.view.TUI.utils.CLIGridPosition

public class CLIGridPosition extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
    static final int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    CLIGridPosition(Position modelPosition)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    getStringColumn(int horizontalOffset)
    Gets the cursor column, considering the visible section PLEASE NOTE: This method does not account for modifiers offsets
    int
    getStringRow(int verticalOffset)
    Gets the cursor row, considering the visible section
    int
    getTranslatedColumn(int horizontalOffset)
    Gets the grid column, considering the visible section
    int
    getTranslatedRow(int verticalOffset)
    Gets the grid row, considering the visible section

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • CLIGridPosition

      public CLIGridPosition(Position modelPosition)
      Parameters:
      modelPosition - The position of the card in the model
  • Method Details

    • getTranslatedRow

      public int getTranslatedRow(int verticalOffset)
      Gets the grid row, considering the visible section
      Parameters:
      verticalOffset - The vertical offset of the grid (+1 shows the page under, -1 shows the page above)
    • getTranslatedColumn

      public int getTranslatedColumn(int horizontalOffset)
      Gets the grid column, considering the visible section
      Parameters:
      horizontalOffset - The horizontal offset of the grid (+1 shows the page to the right, -1 shows the page to the left)
    • getStringRow

      public int getStringRow(int verticalOffset)
      Gets the cursor row, considering the visible section
      Parameters:
      verticalOffset - The vertical offset of the grid (+1 shows the page under, -1 shows the page above)
    • getStringColumn

      public int getStringColumn(int horizontalOffset)
      Gets the cursor column, considering the visible section PLEASE NOTE: This method does not account for modifiers offsets
      Parameters:
      horizontalOffset - The horizontal offset of the grid (+1 shows the page to the right, -1 shows the page to the left)