Package fr.uga.miage.pc.dilemme.back
Class Confrontation
java.lang.Object
fr.uga.miage.pc.dilemme.back.Confrontation
public class Confrontation
extends java.lang.Object
This class allows to construct a object fight. This object describes all the features of a fight, the opponent, name and others.
This class was created for a french university project
- Since:
- 1.0
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceConfrontation.ConfrontationConstantsThis is interface is here to define all the constants associated to the class Confrontation -
Constructor Summary
Constructors Constructor Description Confrontation(IStrategie s1, IStrategie s2)Constructs the fight with the two opponents given in parameter -
Method Summary
Modifier and Type Method Description intgetFinalScore(int numStrategie)Give the final score of the first or second strategieintgetFinalScoreS1()Deprecated.Use getFinalScore(int numStrategie) insteadintgetFinalScoreS2()Deprecated.Use getFinalScore(int numStrategie) insteadIStrategiegetStrategie(int numStrategie)Give the first or the second strategie in function of the number given in parameterIStrategiegetStrategie1()Deprecated.Use getStrategie(int numStrategie) insteadIStrategiegetStrategie2()Deprecated.Use getStrategie(int numStrategie)voidsetStrategie(int numStrategie, IStrategie strategie)Set the first or second Strategie of the confrontationvoidsetStrategie1(IStrategie strategie1)Deprecated.Use setStrategie(int numStrategie, IStrategie strategie)voidsetStrategie2(IStrategie strategie2)Deprecated.Use setStrategie(int numStrategie, IStrategie strategie) insteadvoidstart(int nbTours)Start the fight between the two opponentsjava.lang.StringtoString()Give a brief description of the fight
-
Constructor Details
-
Confrontation
Constructs the fight with the two opponents given in parameter- Parameters:
s1- The first opponents2- The second opponnent- Since:
- 1.0
- See Also:
IStrategie
-
-
Method Details
-
getStrategie
Give the first or the second strategie in function of the number given in parameter- Parameters:
numStrategie- The number of the Strategie to return- Since:
- 3.0
- See Also:
Confrontation.ConfrontationConstants
-
setStrategie
Set the first or second Strategie of the confrontation- Parameters:
numStrategie- The number of the Strategie to return- Since:
- 3.0
- See Also:
Confrontation.ConfrontationConstants
-
getFinalScore
public int getFinalScore(int numStrategie)Give the final score of the first or second strategie- Parameters:
numStrategie- The strategie that we want the final score- Returns:
- the final of a strategie
- Since:
- 3.0
- See Also:
Confrontation.ConfrontationConstants
-
toString
public java.lang.String toString()Give a brief description of the fight- Overrides:
toStringin classjava.lang.Object- Returns:
- String The versus of this fight
- See Also:
IStrategie.getNom()
-
start
public void start(int nbTours)Start the fight between the two opponents- Parameters:
nbTours- Number of round in this fight- See Also:
IStrategie.clear(),IStrategie.setOppPlay(String)
-
setStrategie1
Deprecated.Use setStrategie(int numStrategie, IStrategie strategie)Change the first opponent of the fight- Parameters:
IStrategie- a strategie
-
setStrategie2
Deprecated.Use setStrategie(int numStrategie, IStrategie strategie) insteadChange the second opponent of the fight- Parameters:
IStrategie- a strategie
-
getFinalScoreS1
@Deprecated public int getFinalScoreS1()Deprecated.Use getFinalScore(int numStrategie) insteadReturn the final score of the fight for the first Opponent- Returns:
- int Final score for the first opponent
- Since:
- 1.0
-
getFinalScoreS2
@Deprecated public int getFinalScoreS2()Deprecated.Use getFinalScore(int numStrategie) insteadReturn the final score of the fight for the second Opponent- Returns:
- int Final score for the second opponent
- Since:
- 1.0
-
getStrategie1
Deprecated.Use getStrategie(int numStrategie) insteadGive the object which represents the first opponent- Returns:
- IStrategie First opponent
- See Also:
IStrategie
-
getStrategie2
Deprecated.Use getStrategie(int numStrategie)Give the object which represents the first opponent- Returns:
- IStrategie First opponent
- See Also:
IStrategie
-