Interface View

All Superinterfaces:
fr.formiko.usual.Progression
All Known Implementing Classes:
ViewCLI, ViewGUI2d, ViewNull

public interface View extends fr.formiko.usual.Progression
Main view interface.
All views need to implement this interface !
All action sould be independent and should be launchable after 1 launch of view.ini().
Author:
Hydrolien
  • Method Details

    • getActionGameOn

      boolean getActionGameOn()
    • ini

      boolean ini()
      Initialize all the thing that need to be Initialize before using view.
      Returns:
      Return true if it work well. (Nothing goes wrong.)
    • close

      boolean close()
      close all the thing that need to be close after using view.
      Returns:
      Return true if it work well. (Nothing goes wrong.)
    • paint

      boolean paint()
      Refrech actual view.
      Returns:
      Return true if it work well. (Nothing goes wrong.)
    • actionGame

      boolean actionGame()
      Launch action game part.
      Returns:
      Return true if it work well. (Nothing goes wrong.)
    • pauseActionGame

      int pauseActionGame()
      Stop game and print the escape menu.
      This action can only be run if action game is on.
      Returns:
      Return 0 if it work well. (Nothing goes wrong.)
    • endActionGame

      boolean endActionGame(boolean withButton, int nextLevel, String message, GJoueur gj, boolean canResumeGame)
      Stop game and print the end menu.
      This action can only be run if action game is on.
      Parameters:
      withButton - true if we need to add button "return to main menu" and "next level".
      nextLevel - the number of the next level to link to the button. -1 = no next level.
      message - message to print.
      gj - sorted player list to print.
      Returns:
      Return true if it work well. (Nothing goes wrong.)
    • setLookedCCase

      boolean setLookedCCase(CCase cc)
      Change the value of the looked CCase.
      We need to repaint the information about this Case.
      This action can only be run if action game is on.
      Returns:
      Return true if it work well. (Nothing goes wrong.)
    • getLookedCCase

      CCase getLookedCCase()
      Return the value of the looked CCase.
      This action can only be run if action game is on.
      Returns:
      lookedCCase
    • getAntChoice

      int getAntChoice(int[] t)
      Return the chosen value for ant action.
      This action can only be run if action game is on.
      Returns:
      Return ant choice.
    • getCCase

      CCase getCCase()
      Return the chosen CCase.
      It is used to move ant.
    • message

      void message(String message, boolean doWeNeedToDoNextCmdNow)
      Print a message.
      If message.equals("") we may need to delete last message, but we don't need to print a new message.
      Parameters:
      message - the message to print.
      doWeNeedToDoNextCmdNow - true if we need to do next commande now.
    • loadingMessage

      void loadingMessage(String message, int percentageDone)
      Print a loading message.
      Parameters:
      message - the message to print.
      percentageDone - the percentage of loading curently done.
    • popUpMessage

      void popUpMessage(String message)
      Print a message in a new window.
      Parameters:
      message - the message to print.
    • popUpQuestion

      String popUpQuestion(String message)
      Print a question in a new window.
      Parameters:
      message - the message to print.
      Returns:
      the answer.
    • popUpQuestionYN

      boolean popUpQuestionYN(String message, boolean important, fr.formiko.usual.CheckFunction cf)
      Print a yes/no question in a new window.
      Parameters:
      message - the message to print.
      important - some gui action will be done if true
      cf - CheckFunction to use to get text, default checked & launch function
      Returns:
      the answer.
    • popUpQuestionYN

      default boolean popUpQuestionYN(String message, boolean important)
    • popUpQuestionYN

      default boolean popUpQuestionYN(String message)
    • setPlayingAnt

      void setPlayingAnt(Fourmi f)
      set playing ant.
      This action can only be run if action game is on.
    • move

      void move(ObjetSurCarteAId o, CCase from, CCase to)
      move ObjetSurCarteAId.
      This action can only be run if action game is on.
      Parameters:
      o - object to move.
      from - CCase that o leave.
      to - CCase were o is going.
    • waitForEndTurn

      default void waitForEndTurn()
      Wait for end turn if we need.
    • getMoveMode

      default boolean getMoveMode()
      True if in moveMode.
    • setMoveMode

      default void setMoveMode(boolean b)
      Default fontion to move.
    • centerOverCase

      default void centerOverCase(Case c)
      Center map over a Case.
      Parameters:
      c - case to center over
    • isBladesEnable

      default boolean isBladesEnable()
      True if grass blades are enable.
    • makeUserChooseOnArray

      default String makeUserChooseOnArray(String[] array, String varName)
      Make user choose in a String array.
      Parameters:
      array - the array where to choose
      varName - the name of the variable tp choose
    • makeUserChooseInt

      default int makeUserChooseInt(int min, int max, String varName)
      Make user choose an int in [min, max].
      Default use makeUserChooseOnArray() to let user choose.
      Parameters:
      min - the min value
      max - the max value
      varName - the name of the variable tp choose