Package fr.uga.miage.pc.dilemme.back
Class ApiDilemme
java.lang.Object
fr.uga.miage.pc.dilemme.back.ApiDilemme
public final class ApiDilemme
extends java.lang.Object
This class is used like an API, it give the possibilty to the front
class to call the method of the back-end
- Since:
- 3.0
-
Constructor Summary
Constructors Constructor Description ApiDilemme() -
Method Summary
Modifier and Type Method Description static java.lang.StringconfrontationHtml(int num, Confrontation confrontation)Return a sum up of the confrontation given in parameter in HTMLstatic java.lang.StringconfrontationText(int num, Confrontation confrontation)Return a sum up of the confrontation given in parameterstatic ConfrontationcreateConfrontation(IStrategie s1, IStrategie s2)Create a confrontation between two Strategiesstatic DonnantDonnantcreateDonnantDonnant()Create a new instance of DonnantDonnantstatic DonnantDonnantDurcreateDonnantDonnantDur()Create a new instance of DonnantDonnantDurstatic GentillecreateGentille()Create a new instance of Gentillestatic java.util.List<IStrategie>createListStrategie(int... choices)Create a list of the Strategie in function of the choice made by the userstatic java.util.List<IStrategie>createListStrategie(java.util.List<java.lang.Integer> choices)Create a list of the Strategie in function of the choice made by the userstatic MechantecreateMechante()Create a new instance of Mechantestatic MefiantecreateMefiante()Create a new instance of Mefiantestatic PerGentillecreatePerGentille()Create a new instance of PerGentillestatic PerMechantcreatePerMechante()Create a new instance of PerMechantstatic RancunierecreateRancuniere()Create a new instance of Rancunierestatic TournoicreateTournoi(java.util.List<IStrategie> strategies, int nbTours)static java.lang.StringsumUpTournoiHtml()Return a sum up of the score of the tournament in HTMLstatic java.lang.StringsumUpTournoiText()Return a sum up of the score of the tournamentstatic java.lang.StringtournoiHtml()Return a sum up of the configuration of the tournament in HTMLstatic java.lang.StringtournoiText()Return a sum up of the configuration of the tournament
-
Constructor Details
-
ApiDilemme
public ApiDilemme()
-
-
Method Details
-
createTournoi
public static Tournoi createTournoi(java.util.List<IStrategie> strategies, int nbTours) throws java.lang.NullPointerException, java.lang.Exception- Parameters:
strategies- List of strategies for the tournamentnbTours- Number of round per Confrontation- Returns:
- Tournoi - The tournament created
- Throws:
java.lang.NullPointerException- if the list of strategies is nulljava.lang.Exception- If the user doesn't give at least one Strategie- Since:
- 3.0
- See Also:
Tournoi(int, List)
-
tournoiHtml
public static java.lang.String tournoiHtml()Return a sum up of the configuration of the tournament in HTML- Returns:
- String - A sum up of the configuration of the tournament
- Since:
- 3.0
- See Also:
StringHelper.tournoi(boolean, Tournoi)
-
tournoiText
public static java.lang.String tournoiText()Return a sum up of the configuration of the tournament- Returns:
- String - A sum up of the configuration of the tournament
- Since:
- 3.0
- See Also:
StringHelper.tournoi(boolean, Tournoi)
-
confrontationHtml
Return a sum up of the confrontation given in parameter in HTML- Parameters:
num- The number of the confrontationconfrontation- The confrontation for the sum up- Returns:
- String - A sum up of the confrontation
- Since:
- 3.0
- See Also:
StringHelper.sumUpConfrontation(boolean, int, Confrontation)
-
confrontationText
Return a sum up of the confrontation given in parameter- Parameters:
num- The number of the confrontationconfrontation- The confrontation for the sum up- Returns:
- String - A sum up of the confrontation
- Since:
- 3.0
- See Also:
StringHelper.sumUpConfrontation(boolean, int, Confrontation)
-
sumUpTournoiHtml
public static java.lang.String sumUpTournoiHtml()Return a sum up of the score of the tournament in HTML- Returns:
- String - A sum up of the score of the tournament
- Since:
- 3.0
- See Also:
StringHelper.sumUpTournoi(boolean, Tournoi)
-
sumUpTournoiText
public static java.lang.String sumUpTournoiText()Return a sum up of the score of the tournament- Returns:
- String - A sum up of the score of the tournament
- Since:
- 3.0
- See Also:
StringHelper.sumUpTournoi(boolean, Tournoi)
-
createListStrategie
Create a list of the Strategie in function of the choice made by the user- Parameters:
choices- List of choice made by the user- Returns:
- The list of strategies created
- Since:
- 3.0
- See Also:
createListStrategie(List),Strategie(String, String)
-
createListStrategie
public static java.util.List<IStrategie> createListStrategie(java.util.List<java.lang.Integer> choices)Create a list of the Strategie in function of the choice made by the user- Parameters:
choices- List of choice made by the user- Returns:
- The list of strategies created
- Since:
- 3.0
- See Also:
Strategie(String, String)
-
createGentille
Create a new instance of Gentille- Returns:
- Gentille The gentille strategie
- Since:
- 3.0
- See Also:
Gentille()
-
createMechante
Create a new instance of Mechante- Returns:
- Mechante The "mechante" strategie
- Since:
- 3.0
- See Also:
Mechante()
-
createDonnantDonnant
Create a new instance of DonnantDonnant- Returns:
- DonnantDonnant The "donnant-donnant" strategie
- Since:
- 3.0
- See Also:
DonnantDonnant()
-
createDonnantDonnantDur
Create a new instance of DonnantDonnantDur- Returns:
- DonnantDonnantDur The "donnant-donnant dur" strategie
- Since:
- 3.0
- See Also:
DonnantDonnantDur()
-
createMefiante
Create a new instance of Mefiante- Returns:
- Mefiante The "mefiante" strategie
- Since:
- 3.0
- See Also:
Mefiante()
-
createPerGentille
Create a new instance of PerGentille- Returns:
- PerGentille The "periodique-gentille" strategie
- Since:
- 3.0
- See Also:
PerGentille()
-
createPerMechante
Create a new instance of PerMechant- Returns:
- PerMechant The "periodique-mechante" strategie
- Since:
- 3.0
- See Also:
PerMechant()
-
createRancuniere
Create a new instance of Rancuniere- Returns:
- Rancuniere The "rancuniere" strategie
- Since:
- 3.0
- See Also:
Rancuniere()
-
createConfrontation
Create a confrontation between two Strategies- Returns:
- Confrontation
- Since:
- 3.0
- See Also:
Confrontation(IStrategie, IStrategie)
-