Package fr.formiko.views
Interface View
- All Superinterfaces:
fr.formiko.usual.Progression
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().
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 Summary
Modifier and TypeMethodDescriptionboolean
Launch action game part.default void
Center map over a Case.boolean
close()
close all the thing that need to be close after using view.boolean
endActionGame
(boolean withButton, int nextLevel, String message, GJoueur gj, boolean canResumeGame) Stop game and print the end menu.boolean
int
getAntChoice
(int[] t) Return the chosen value for ant action.getCCase()
Return the chosen CCase.Return the value of the looked CCase.default boolean
True if in moveMode.boolean
ini()
Initialize all the thing that need to be Initialize before using view.default boolean
True if grass blades are enable.void
loadingMessage
(String message, int percentageDone) Print a loading message.default int
makeUserChooseInt
(int min, int max, String varName) Make user choose an int in [min, max].default String
makeUserChooseOnArray
(String[] array, String varName) Make user choose in a String array.boolean
Load the save load menu.boolean
menuMain()
Load main menu.boolean
Load new game menu.boolean
options menu.boolean
personalise a game menu.void
Print a message.void
move
(ObjetSurCarteAId o, CCase from, CCase to) move ObjetSurCarteAId.boolean
paint()
Refrech actual view.int
Stop game and print the escape menu.void
popUpMessage
(String message) Print a message in a new window.popUpQuestion
(String message) Print a question in a new window.default boolean
popUpQuestionYN
(String message) default boolean
popUpQuestionYN
(String message, boolean important) boolean
popUpQuestionYN
(String message, boolean important, fr.formiko.usual.CheckFunction cf) Print a yes/no question in a new window.boolean
setLookedCCase
(CCase cc) Change the value of the looked CCase.default void
setMoveMode
(boolean b) Default fontion to move.void
set playing ant.default void
Wait for end turn if we need.Methods inherited from interface fr.formiko.usual.Progression
closeLauncher, iniLauncher, setButtonRetryVisible, setDownloadingMessage, setDownloadingValue
-
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
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
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
Print a loading message.- Parameters:
message
- the message to print.percentageDone
- the percentage of loading curently done.
-
popUpMessage
Print a message in a new window.- Parameters:
message
- the message to print.
-
popUpQuestion
Print a question in a new window.- Parameters:
message
- the message to print.- Returns:
- the answer.
-
popUpQuestionYN
Print a yes/no question in a new window.- Parameters:
message
- the message to print.important
- some gui action will be done if truecf
- CheckFunction to use to get text, default checked & launch function- Returns:
- the answer.
-
popUpQuestionYN
-
popUpQuestionYN
-
setPlayingAnt
set playing ant.
This action can only be run if action game is on. -
move
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
Center map over a Case.- Parameters:
c
- case to center over
-
isBladesEnable
default boolean isBladesEnable()True if grass blades are enable. -
makeUserChooseOnArray
Make user choose in a String array.- Parameters:
array
- the array where to choosevarName
- the name of the variable tp choose
-
makeUserChooseInt
Make user choose an int in [min, max].
Default use makeUserChooseOnArray() to let user choose.- Parameters:
min
- the min valuemax
- the max valuevarName
- the name of the variable tp choose
-