Class GCase

java.lang.Object
fr.formiko.formiko.GCase
All Implemented Interfaces:
Serializable

public class GCase extends Object implements Serializable
A Groups of squares with most of the map items.
Author:
Hydrolien
See Also:
  • Field Details

    • actuelle

      private CCase actuelle
    • ccases

      private CCase[][] ccases
    • width

      private int width
    • height

      private int height
  • Constructor Details

    • GCase

      public GCase(int width, int height)
    • GCase

      public GCase(int taille)
    • GCase

      public GCase()
  • Method Details

    • getHead

      public CCase getHead()
    • getFirst

      public Case getFirst()
    • getDim

      public String getDim()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getCCase

      public CCase getCCase(int x, int y)
    • getCCase

      public CCase getCCase(fr.formiko.usual.Point p)
    • getWidth

      public int getWidth()
    • getHeight

      public int getHeight()
    • length

      public int length()
    • getCCaseAllĂ©a

      public CCase getCCaseAllĂ©a()
    • setTypes

      public void setTypes(String[] t)
      Set types for all squares from String[] as a csv file.
    • tourCases

      public void tourCases()
      Play a turn for all squares.
    • asX

      private int asX(int x)
      Check that it's a correct x.
      If it's not it will be set at max or min value.
    • asY

      private int asY(int y)
      Check that it's a correct y.
      If it's not it will be set at max or min value.
    • getCasesBetween

      public fr.formiko.usual.structures.listes.Liste<Case> getCasesBetween(int x1, int y1, int x2, int y2)
      Give all Case in a rectangle as a list.
      Parameters:
      x1 - x of the 1a Square
      y1 - y of the 1a Square
      x2 - x of the 2a Square
      y2 - y of the 2a Square
    • getCasesBetween

      public fr.formiko.usual.structures.listes.Liste<Case> getCasesBetween(CCase from, CCase to)
      Give all Case in a rectangle as a list.
      Parameters:
      from - 1a corner of the rectangle
      to - 2a corner of the rectangle
    • getCasesBetween

      public fr.formiko.usual.structures.listes.Liste<Case> getCasesBetween(CCase center, int radius)
      Give all Case in a rectangle as a list.
      Parameters:
      center - of the rectangle
      radius - distance with the wall of the rectangle