Class MapPath

java.lang.Object
fr.formiko.formiko.MapPath

public class MapPath extends Object
Path for map move.
Author:
Hydrolien
  • Field Details

    • path

      private fr.formiko.usual.structures.listes.Liste<CCase> path
    • movingCaseByTurn

      private fr.formiko.usual.structures.listes.Liste<Integer> movingCaseByTurn
  • Constructor Details

    • MapPath

      public MapPath(CCase from, CCase to)
      Main constructor that build the path.
      Parameters:
      from - starting CCase
      to - ending CCase
  • Method Details

    • getList

      public fr.formiko.usual.structures.listes.Liste<CCase> getList()
    • getMovingCaseByTurn

      public fr.formiko.usual.structures.listes.Liste<Integer> getMovingCaseByTurn()
    • toString

      public String toString()
      Strandard toString function.
      Overrides:
      toString in class Object
    • addPath

      public void addPath(CCase from, CCase to)
      Add path CCase by CCase.
      Parameters:
      from - starting CCase
      to - ending CCase
    • addToPath

      public void addToPath(CCase cc)
      Add a single CCase to the path.
      If CCase is already the last one, it don't add it.
      Parameters:
      cc - CCase to add
    • updateMovingCaseByTurn

      public void updateMovingCaseByTurn(Creature c)
    • getNextCCase

      public static CCase getNextCCase(CCase from, CCase to)
      get the next CCase to go to reach last Case "to".
      Parameters:
      from - starting CCase
      to - target CCase
    • getNextCCase

      public static CCase getNextCCase(CCase from, int d)
      get the next CCase to go to reach last Case "to".
      Parameters:
      from - starting CCase
      d - direction where to go